On page 97 of John B.conway's Functions of one complex variable,the author states that:"Suppose $G$ is a region (open connected subset) and let $f$ be analytic in $G$ with zeros at $a_1,a_2,...,a_m$.So we can write $f(z)=z(z-a_1)(z-a_2)...(z-a_m)g(z)$ where $g$ is analytic on $G$ and $g(z)\neq 0$ for any $z$ in $G$.."The author use this result to show that: $\frac{1}{2\pi i} \int_{\gamma} \frac{f'(z)}{f(z)} dz=\sum_{i=1}^{m} n(\gamma;a_k)$.
I just don't understand how to show that the numberof roots of $f$ in $G$ is finite.Can someone explain this to me? Thank you.