By the definition of the algebraic multiplicity (Definition AME), we can factor the characteristic polynomial as \begin{equation*} \charpoly{A}{x}=c(x-\lambda_1)^{\algmult{A}{\lambda_1}}(x-\lambda_2)^{\algmult{A}{\lambda_2}}(x-\lambda_3)^{\algmult{A}{\lambda_3}}\cdots(x-\lambda_k)^{\algmult{A}{\lambda_k}} \end{equation*} where $c$ is a nonzero constant. (We could prove that $c=(-1)^{n}$, but we do not need that specificity right now. See Exercise PEE.T30) The left-hand side is a polynomial of degree $n$ by Theorem DCP and the right-hand side is a polynomial of degree $\sum_{i=1}^{k}\algmult{A}{\lambda_i}$. So the equality of the polynomials' degrees gives the equality $\sum_{i=1}^{k}\algmult{A}{\lambda_i}=n$.