This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] $A=I+N$ with $N=A-I=\begin{bmatrix}1&-1\\1&-1\end{bmatrix}$, $N^2=0$. So $A^k=I+kN$ for every integer $k$. The equation becomes $2I+(m^2+m)N=3I-(I-6N)=2I+6N$, so $m^2+m=6\Rightarrow m=2$ or $-3$. $n(S)=2$. Answer: 2.