Let $X$ be a compact Riemann surface and $f:X\to\mathbb{C}$ be a holomorphic function. By the local normal form, for each point $p\in X$ there exists a chart $\varphi:U\to V$ in $X$ centered at $p$, and an integer $m$ such that $$f\circ\varphi^{-1}(z)=z^m$$ in a neighborhood of $0$. This integer is called the multiplicity of $f$ at $p$. We will denote it by $\text{Mult}_p(f)$.
We then know that there is only a finite number of points $p$ where $\text{Mult}_p(f)$ is non-zero. Moreover, $$\sum_{p\in X} \text{Mult}_p(f)=0.$$
I also saw some texts saying that the sum of orders of zeros of a holomorphic function in a genus $g$ Riemann surface is equal to $2g-2$. Isn't this sum exactly $$\sum_{p\in X} \text{Mult}_p(f)\:\:\:?$$
I would like to understand exactly what this phrase "the sum of orders of zeros of a holomorphic function in a genus $g$ Riemann surface is equal to $2g-2$" means and, if possible, how to prove it. (If needed, I understand the Riemann-Hurwitz formula.)