3. The values of the sequence $x_{1}, x_{2}, \cdots, x_{n}(n \geqslant 2)$ can independently take $-1, 0$, and $1, S$ represents the sum of all products obtained by multiplying these numbers in pairs. Try to find the minimum value of $S$.

---

The translation maintains the original text's format and line breaks.
$$
\begin{array}{r}
\text { (Hint: } S=\sum_{1 \leqslant i<j<n} x_{1} x_{j}=\frac{1}{2}\left[\left(x_{1}+x_{2}+\cdots+x_{n}\right)^{2}\right. \\
\left.-\left(x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}\right)\right] \geqslant-\frac{1}{2}\left(x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}\right) .
\end{array}
$$

If $n$ is even, $S_{\text {min }}=-\frac{n}{2}$; if $n$ is odd, $S_{\text {min }}=$
$$
-\frac{n-1}{2} \text {.) }
$$