I want to show that, for all differentials on the same Riemann surface S the number of poles minus the number of zeros, counting multiplicities, always equals $2-2g$. It says this can be deduced from the following result:
By Riemann-Roch theorem we know that the dimension of holomorphic differentials on Riemann surface $S$ equals $g(S)$, the genus of $S$, and that the $g$ elements of any basis cannot have common zeros.
I have no idea.
The number you want to compute is $$\deg K_S,$$ the degree of the canonical divisor. This appears in the Riemann-Roch formula: $$h^0(K_S)=\deg K_S+1-g+h^0(K_S-K_S).$$ Now you need to use:
Then you get $\deg K_S=2g-2$.