12. (2003 Bulgarian Mathematical Olympiad) Find the number of real solutions to the system of equations $\left\{\begin{array}{l}x+y+z=3 x y \\ x^{2}+y^{2}+z^{2}=3 x z \\ x^{3}+y^{3}+z^{3}=3 y z\end{array}\right.$.
12. When $y=0$, from the first equation we get $x=-z$, and from the second equation, we derive $x=z=0$. Therefore, $(0,0,0)$ is one solution.

Assume $y \neq 0$, let $a=\frac{x}{y}, b=\frac{z}{y}$. Then, the three equations of the system become $1+a+b=3 a y, 1+a^{2}+b^{2}=3 a b, y\left(1+a^{3}+\right.$ $\left.b^{3}\right)=3 b$. Replacing $y$ with $\frac{1+a+b}{3 a}$, we get $\left\{\begin{array}{l}(1+a+b)\left(1+a^{3}+b^{3}\right)=9 a b, \\ 1+a^{2}+b^{2}=3 a b .\end{array}\right.$ Let $u=a+b, v=a b$, then we have $\left\{\begin{array}{l}(1+u)\left(1+u^{2}-3 u v\right)=9 v \\ 1+u^{2}-2 v=3 v\end{array}\right.$

Thus, $v=\frac{1}{5}\left(u^{2}+1\right)$, and we get $0=u^{4}+u^{3}-6 u^{2}+u-2=(u-2)\left(u^{3}+3 u^{2}+1\right)$. When $u=2$, we find $v=1, a=b=1$. Therefore, we obtain one solution $(x, y, z)=(1,1,1)$.
The function $f(u)=u^{3}+3 u^{2}+1$ has a local maximum at $u=-2$ and a local minimum at $u=0$.
Since $f(0)=1>0$, the equation $f(u)=0$ has a unique real root $u_{0}$, where $u_{0}<0$, and thus the system of equations $\left\{\begin{array}{l}a+b=u_{0} \\ a b=\frac{1}{5}\left(u_{0}^{2}+1\right)\end{array}\right.$ has two solutions.
Therefore, we obtain two additional solutions to the given system of equations. Hence, the original system of equations has 4 real solutions.