Let $S$ be a Riemann surface of genus $g$ and $f: S\to \mathbb CP^1$ be a degree $d$ meromorphic function. Then Reimann-Hurwitz tells us that the number of ramifications of $f$ counted with multiplicity is $2(d-1)+2g-2$. 

Suppose we consider instead a map of $\varphi: S\to \mathbb CP^1$ of degree $d$ that is smooth, but not necessarily holomorphic. Then it will have singularities, like folds, etc. 

**Question.** Is it possible to get this number $2(d-1)+2g-2$ as an expression involving various types of singularities of the map $\varphi$?