3. In a certain football league, a double round-robin system (i.e., two teams play each other twice) is used, with $m$ teams participating. At the end of the competition, a total of $9 n^{2}+6 n+32$ matches were played, where $n$ is an integer. Then $m=$ $\qquad$.
3.8 or 32.

According to the problem, we have
$$
\begin{array}{l}
9 n^{2}+6 n+32=2 \times \frac{1}{2} m(m-1) \\
\Rightarrow(6 n+2)^{2}-(2 m-1)^{2}=-125 \\
\Rightarrow(6 n+2 m+1)(6 n-2 m+3)=-125 .
\end{array}
$$

Obviously, $6 n+2 m+1 \geqslant 6 n-2 m+3$.
Thus, $6 n+2 m+1$ can take the values $1, 5, 25, 125$, and correspondingly, $6 n-2 m+3$ are $-125, -25, -5, -1$ respectively.

Upon inspection, $(m, n)=(8,-2)$ or $(32,10)$ satisfy the conditions.
Therefore, $m=8$ or 32.