I'm reading Theorem 4.14 (p. 70) of Rotman's Intro to Algebraic Topology. He proves that if $X$ is a nonempty path connected space, then $H_0(X)\simeq\mathbb{Z}$, and if $x_0,x_1\in X$, then $cls(x_0)=cls(x_1)$ is a generator of $H_0(X)$. Here $cls(x)$ is the homology class of $x$ in $H_0(X)$.
He writes
If $cls(\gamma)$ is a generator of $H_0(X)$, where $\gamma=\sum m_ix_i$, then $\sum m_i=\pm 1$.
Why is this? I don't follow this step in his proof.