B. Let $n$ be an integer, and $1 \leqslant n \leqslant 2012$. If $\left(n^{2}-n+3\right)\left(n^{2}+n+3\right)$ is divisible by 5, then the number of all $n$ is $\qquad$.
B. 1610.

Notice,
$$
\begin{array}{l}
\left(n^{2}-n+3\right)\left(n^{2}+n+3\right) \\
=n^{4}+5 n^{2}+9 \\
=(n-1)(n+1)\left(n^{2}+1\right)+5 n^{2}+10 .
\end{array}
$$

When $n$ is divided by 5, the remainder is 1 or 4, then $n-1$ or $n+1$ is divisible by 5, so
$$
51\left(n^{2}-n+3\right)\left(n^{2}+n+3\right) \text {; }
$$

When $n$ is divided by 5, the remainder is 2 or 3, then $n^{2}+1$ is divisible by 5, so
$$
5 I\left(n^{2}-n+3\right)\left(n^{2}+n+3\right) \text {; }
$$

When $n$ is divided by 5, the remainder is 0,
$$
5 \nmid\left(n^{2}-n+3\right)\left(n^{2}+n+3\right) \text {. }
$$

Therefore, the number of all $n$ that meet the requirements of the problem is
$$
\frac{2010}{10} \times 8+2=1610 .
$$