# How do you calculate the total sample size in stratified sampling?

I know that we can allocate observations from the total sample to each strata either using proportional allocation ($$n_{h}/N_{h} = n/N$$) or optimal allocation:

$$n_{h} = \left [ \frac{\frac{N_{h}S_{h}}{sqrt (c_{h})}}{\sum_{l=1}^{H}\frac{N_{l}S_{l}}{sqrt (c_{l})}{}} \right ]n \tag{1}$$

Where $$N_{h}$$ and $$n_{h}$$ are the population size and sample size in each stratum respectfully. $$c_{h}$$ is the cost of sampling one unit from stratum h, $$S_{h}$$ is the population standard deviation of stratum h and $$n$$ is the total sample size. What I am confused about is how do we actually choose $$n$$. The book I'm using (Lohr's SDA) says that

$$n = \frac{n_{0}}{1 + \frac{n_{0}}{N}\sum_{h = 1}^{H}\frac{N_{h}S_{h}^{2}}{Nv}} \tag{2}$$

where

$$n_{0} = \frac{z_{\alpha/2}^{2}v}{e^{2}} \tag{3}$$

($$e$$ is the margin of error) is the sample size if all strata fpcs could be ignored and

$$v = \sum_{h =1}^{H}\frac{n}{n_{h}} \left ( \frac{N_{h}S_{h}}{N} \right )^{2} \tag{4}$$

What confuses me is that $$n$$ is calculated using $$v$$ and $$n_{0}$$ which themselves are calculated using $$n$$. Could someone provide some clarification?

Equation 1 is a method of allocating samples to strata given a predefined total sample size, resulting in a relative sample size $$n_h/n$$. This can then be adjusted to determine the total sample size necessary to achieve a prespecified variance (Section 4.4.4).