Solution (source code)

= Solution

With local indices $e_p$, the required specialization is
$$
\boxed{2g(C)-2=-2d+\sum_{p\in C}(e_p-1).}
$$
Only the finitely many points of index greater than one contribute. Their images are the <branch points> on the target.