8. Given the set of complex numbers $D$, a complex number $z \in D$ if and only if there exists a complex number $z_{1}$ with modulus 1, such that
$$
|z-2005-2006 \mathrm{i}|=\left|z_{1}^{4}+1-2 z_{1}^{2}\right| \text {. }
$$

Then the number of complex numbers in $D$ whose real and imaginary parts are both integers is $\qquad$
8.49 .

Given $\left|z_{1}\right|=1$, let $z_{1}=\cos \theta+\mathrm{i} \sin \theta$.
$$
\begin{array}{l}
\text { Then }\left|z_{1}^{4}+1-2 z_{1}^{2}\right|=\left|\left(z_{1}^{2}-1\right)^{2}\right|=\left|z_{1}^{2}-1\right|^{2} \\
=|(\cos 2 \theta-1)+\mathrm{i} \sin 2 \theta|^{2} \\
=(\cos 2 \theta-1)^{2}+\sin ^{2} 2 \theta=2-2 \cos 2 \theta=4 \sin ^{2} \theta . \\
\text { Therefore, } z=x+y \mathrm{i} \in D \\
\Leftrightarrow|z-2005-2006 \mathrm{i}| \leqslant 4 \\
\Leftrightarrow(x-2005)^{2}+(y-2006)^{2} \leqslant 16 .
\end{array}
$$

Let $s=x-2005, t=y-2006$, then
$$
z \in D \Leftrightarrow s^{2}+t^{2} \leqslant 16 \text {. }
$$

The latter has a total of 49 solutions.