On a fiber square flat pullback commutes with proper pushforward

I'm working through Fulton's intersection theory book and I've been stuck on the end of Prop 1.7, i.e. that flat pullbacks commute with proper pushforwards for fibre squares. Specifically I understand why it's enough to show that $f'_{*}[X']=d[Y']$, where X,Y are varieties of the same dimension, $f:X\rightarrow Y$ is surjective proper map and $f_{*}[X]=d[Y]$. But this amounts to showing that $d \mathcal l(\mathcal O_{Y_{j}',Y'})=\sum_{X_{i}'\rightarrow Y_j'} \mathcal l(\mathcal O_{X'_i,X'})\deg(X'_i/Y'_j)$, where that sum is over the irreducible components $X_i'$ of $X'$ that map onto the irreducible component $Y_j'$ of $Y'$, and $\mathcal l$ stands for the lengths of those rings over themselves. I don't know how to reduce this to the local calculation Fulton describes, nor how he uses that alegbraic lemma from the appendix to show it once we're in the described local ring case. Can someone please explain this for me? Thanks

-