4. Given real numbers $a, b, c$ satisfy
$$
a+b+c=a^{2}+b^{2}+c^{2} \text {. }
$$

Then the maximum value of $a+b+c$ is $\qquad$
4.3.

By the Cauchy-Schwarz inequality, we have
$$
\begin{array}{l}
3(a+b+c) \\
=\left(1^{2}+1^{2}+1^{2}\right)\left(a^{2}+b^{2}+c^{2}\right)
\end{array}
$$
$$
\begin{array}{l}
\geqslant(a+b+c)^{2} \\
\Rightarrow a+b+c \leqslant 3 .
\end{array}
$$

Equality holds if and only if \(a=b=c=1\).