3. Given the sequence
$$
\begin{array}{l}
a_{1}=\frac{1}{2}, a_{2}=\frac{1}{3}+\frac{2}{3}, \cdots, \\
a_{n}=\frac{1}{n+1}+\frac{2}{n+1}+\cdots+\frac{n}{n+1}, \cdots .
\end{array}
$$

Let $S_{n}=\frac{1}{a_{1} a_{2}}+\frac{1}{a_{2} a_{3}}+\cdots+\frac{1}{a_{n} a_{n+1}}$. Then the integer closest to $S_{2006}$ is $(\quad)$.
(A) 2
(B) 3
(C) 4
(D) 5