Step 1: Explain the idea of effective population size.
Effective population size, denoted as $N_e$, refers to the size of an ideal population that would show the same level of genetic drift or inbreeding as the real population.
Because real populations deviate from ideal conditions, $N_e$ is usually smaller than the actual headcount and is shaped by genetic and demographic factors.
Step 2: Review option (A).
The population size needed to ensure long-term survival is known as the minimum viable population (MVP).
MVP is a conservation concept and is not used for estimating effective population size.
Therefore, option (A) is incorrect.
Step 3: Review option (B).
Carrying capacity represents the maximum number of individuals that an environment can support sustainably.
Although important ecologically, it does not directly define or determine $N_e$.
Hence, option (B) is incorrect.
Step 4: Review option (C).
The total number of individuals across all connected populations describes the overall metapopulation size.
However, effective population size depends on how many individuals actually contribute genes to the next generation, not just the total count.
Thus, option (C) is incorrect.
Step 5: Review option (D).
One of the most important factors affecting effective population size is the number of breeding males and breeding females.
When the sex ratio is uneven, effective population size is calculated using:
\[ N_e = \frac{4N_mN_f}{N_m + N_f} \]
Here, $N_m$ and $N_f$ represent the numbers of breeding males and females, respectively.
This relationship directly links breeding structure to $N_e$, making option (D) correct.
Step 6: Final conclusion.
The factor used to calculate effective population size is:
\[ \boxed{(D)} \]