3. In the arithmetic sequence $\left\{a_{n}\right\}$, if $\frac{a_{11}}{a_{10}}<-1$, and the sum of the first $n$ terms $S_{n}$ has a maximum value, then when $S_{n}$ takes the smallest positive value, the value of $n$ is $\qquad$.
3. 19 .

Since the sum of the first $n$ terms $S_{n}$ of the arithmetic sequence $\left\{a_{n}\right\}$ has a maximum value, then the first term $a_{1}>0$, common difference $d<0$, and
$$
\begin{array}{l}
a_{10}>0, a_{11}<0, \\
S_{19}-S_{1}=9\left(a_{10}+a_{11}\right)<0 .
\end{array}
$$

Thus $n=19$.