In R, use `power.anova.test` to calculate statistical power or the sample size required to achieve a specified power. Note that the $n$ reported by this test is the number of replications *per group*.
If the design is more complex, you can use simulations to estimate power.