3. Let $a_{1}, a_{2}, \cdots, a_{2011}$ be positive real numbers, $S=\sum_{i=1}^{2011} a_{i}$, and
$$
\begin{array}{l}
(S+2011)\left(S+a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{2011} a_{1}\right) \\
=4\left(\sqrt{a_{1} a_{2}}+\sqrt{a_{2} a_{3}}+\cdots+\sqrt{a_{2011} a_{1}}\right)^{2} .
\end{array}
$$

Then $S=$ . $\qquad$
3. 2011.

By the Cauchy-Schwarz inequality, we have
$$
\begin{aligned}
& (S+2011)\left(S+a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{2011} a_{1}\right) \\
= & \left(a_{1}+a_{2}+\cdots+a_{2011}+\frac{1+\cdots+1}{2011}\right) . \\
& \left(a_{2}+a_{3}+\cdots+a_{1}+a_{1} a_{2}+\cdots+a_{2011} a_{1}\right) \\
\geqslant & {\left[2\left(\sqrt{a_{1} a_{2}}+\sqrt{a_{2} a_{3}}+\cdots+\sqrt{a_{2011} a_{1}}\right)\right]^{2} . }
\end{aligned}
$$

Since equality holds, we have
$$
\frac{a_{1}}{a_{2}}=\frac{a_{2}}{a_{3}}=\cdots=\frac{a_{2011}}{a_{1}}=\frac{1}{a_{1} a_{2}}=\cdots=\frac{1}{a_{2011} a_{1}} \text {. }
$$

Thus, $a_{1}=a_{2}=\cdots=a_{2011}=1$.
Therefore, $S=2011$.