Understanding residue of meromorphic 1-form.

I didn't understand this residue computation of the product of a meromorphic function $f$ on an algebraic curve and meromorphic 1-form $\omega \in L^{(1)}(-D)$ :

$Res_{p}(f \omega) \quad = \text{ coefficient of the term } \dfrac{1}{z_{p}}dz_{p} \text{ of }$ $$\sum_{k}a_kz_p^k\sum_{n = D(p)}^{\infty}c_nz_p^ndz_p \quad = \sum_{n=D(p) }^{\infty}c_na_{-1-n}$$ This is an extract taken from Rick Miranda's book on Riemann surfaces and algebraic curves, page 187. I did not understand the last equality, if someone could explain it with details I would be grateful. Thank you.

Haha, I'm actually reading this text now as well. I just read this section. Note that $$\left(\sum_ka_kz_p^k\right)\left(\sum_{n=D(p)}^{\infty}c_nz_p^n\right)=\sum_{k,n}^{\infty}a_kc_nz^{k+n}_p,$$ so the coeffient we're looking for is the coefficient where $k+n=-1$, or $$\sum_{k+n=-1}a_kc_n=\sum_{n=D(p)}^{\infty}a_{-n-1}c_n.$$ It's just using the common identity $$\left(\sum_{n=1}^{\infty}a_n\right)\left(\sum_{k=1}^{\infty}b_k\right)=\sum_{n,k=1}^{\infty}a_nb_k$$ which is useful to know.