\(\Leftrightarrow2^{x^2-3x+2}+2^{x^2+6x+5}=2^{\left(x^2-3x+2\right)+\left(x^2+6x+5\right)}+1\)
\(\Leftrightarrow2^{x^2-3x+2}.2^{x^2+6x+5}-2^{x^2-3x+1}-2^{x^2+6x+5}+1=0\)
\(\Leftrightarrow2^{x^2-3x+2}\left(2^{x^2+6x+5}-1\right)-\left(2^{x^2+6x+5}-1\right)=0\)
\(\Leftrightarrow\left(2^{x^2-3x+2}-1\right)\left(2^{x^2+6x+5}-1\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}2^{x^2-3x+2}=1\\2^{x^2+6x+5}=1\end{matrix}\right.\)
\(\Leftrightarrow\left[{}\begin{matrix}x^2-3x+2=0\\x^2+6x+5=0\end{matrix}\right.\)
\(\Rightarrow x=\left\{1;2;-1;-5\right\}\)
\(\Rightarrow S=1+2-1-5=-3\)