Generalized argument principle and elliptic functions This is a homework question, so please only hints / suggestions if at all possible.  The question asks

If $f$ is an elliptic function with respect to some lattice $\Lambda$ and $z_1, \dotsc, z_k \in \Pi$ are the zeros and poles of $f$ (where $\Pi$ is a fundamental parallelogram) with degrees $d_1, \dotsc, d_k$, then $\sum_k d_k z_k \in \Lambda$.
  (Hint. Consider $\int_{\partial \Pi} z \frac{f'(z)}{f(z)} dz$).

Say $\Lambda$ is spanned by $\omega_1$ and $\omega_2$.  I need to show that $\sum_k d_k z_k = n_1 \omega_1 + n_2 \omega_2$ for some $n_1, n_2 \in \mathbb{Z}$.  I am aware of the generalized argument principle, so that
$$
\int_{\partial \Pi} z \frac{f'(z)}{f(z)} dz = 2 \pi i \left( \sum_{z_k \text{ zero}} n(\partial \Pi, z_k) z_k - \sum_{z_k \text{ pole}} n(\partial \Pi, z_k) z_k \right), $$
but I'm not sure how this helps me.  Any hints or suggestions would be welcomed!
 A: Hint: The boundary of the fundamental parallelogram consists of the four oriented segments
$$[0,\omega_1],\; [\omega_1, \omega_1 + \omega_2],\; [\omega_1+\omega_2,\omega_2],\; [\omega_2,0].$$
Consider the integrals over the pairs of parallel segments as one term. There is a simple relation between the integrands on those two segments.
(If there are any zeros or poles of $f$ on the boundary, consider a slightly translated parallelogram.)

I assume that none of the $z_\kappa$ lies on the boundary $\partial\Pi$, otherwise consider a translation of the fundamental parallelogram by a small $a$ such that no zero or pole lies on $\partial (a+\Pi)$.
Near $z_\kappa$, we can write $f(z) = (z-z_\kappa)^{d_\kappa}\cdot h(z)$ with $h$ holomorphic and nonzero in a neighbourhood of $z_\kappa$. Then in this neighbourhood $f'(z) = d_\kappa(z-z_\kappa)^{d_\kappa - 1}\cdot h(z) + (z-z_\kappa)^{d_\kappa}\cdot h'(z)$, and hence
$$\begin{align}
\frac{f'(z)}{f(z)} &= \frac{d_\kappa}{z-z_\kappa} + \frac{h'(z)}{h(z)}\\
z\frac{f'(z)}{f(z)} &= \frac{d_\kappa z}{z-z_\kappa} + z\frac{h'(z)}{h(z)}\\
&= \frac{d_\kappa z_\kappa}{z-z_\kappa} + d_\kappa + z\frac{h'(z)}{h(z)},
\end{align}$$
so the residue of $z\frac{f'(z)}{f(z)}$ in $z_\kappa$ is $d_\kappa z_\kappa$, and therefore
$$\frac{1}{2\pi i}\int_{\partial \Pi} z\frac{f'(z)}{f(z)}\,dz = \sum_{\kappa = 1}^k d_\kappa z_\kappa\tag{1}$$
by the residue theorem.
On the other hand, considering a pair of parallel boundary segments, we have
$$\begin{align}
\int_{\omega_1}^{\omega_1+\omega_2} z\frac{f'(z)}{f(z)}\,dz &+ \int_{\omega_2}^0 z\frac{f'(z)}{f(z)\,dz}\\
&= \int_0^{\omega_2}(z+\omega_1)\frac{f'(z+\omega_1)}{f(z+\omega_1)} - z\frac{f'(z)}{f(z)}\,dz\\
&= \int_0^{\omega_2} (z+\omega_1)\frac{f'(z)}{f(z)} - z\frac{f'(z)}{f(z)}\,dz \tag{periodicity}\\
&= \omega_1 \int_0^{\omega_2} \frac{f'(z)}{f(z)}\,dz,
\end{align}$$
and similarly for the other pair of boundary segments, so
$$\frac{1}{2\pi i}\int_{\partial\Pi} z\frac{f'(z)}{f(z)}\,dz = \frac{\omega_1}{2\pi i} \int_0^{\omega_2} \frac{f'(z)}{f(z)}\,dz - \frac{\omega_2}{2\pi i}\int_0^{\omega_1} \frac{f'(z)}{f(z)}\,dz.\tag{2}$$
It remains to see that
$$\frac{1}{2\pi i}\int_0^{\omega_\ell} \frac{f'(z)}{f(z)}\,dz \in \mathbb{Z}.$$
Since $f$ has no zeros or poles on the segment $[0,\omega_\ell]$, and $\omega_\ell$ is a period of $f$, $\gamma_\ell = f([0,\omega_\ell])$ is a closed path in $\mathbb{C}\setminus\{0\}$, and
$$\frac{1}{2\pi i}\int_0^{\omega_\ell} \frac{f'(z)}{f(z)}\,dz = \frac{1}{2\pi i}\int_{\gamma_\ell} \frac{dw}{w}$$
is the winding number of $\gamma$ around $0$, hence an integer. Thus
$$\frac{1}{2\pi i}\int_{\partial\Pi} z\frac{f'(z)}{f(z)}\,dz = n(\gamma_2,0)\omega_1 - n(\gamma_1,0)\omega_2 \in \Lambda.$$
