Sample size required to estimate means dependent samples
The formula to estimate the sample size required to estimate the difference between means of dependent samples is
$$ n =\bigg(\frac{z\sigma_d}{E}\bigg)^2 $$
where,

$z$ is the $Z_{\alpha/2}$ (critical value of $Z$),

$\sigma_d$ is the population standard deviation of difference between scores,

$E$ is the margin of error.