I'm trying to understand Example 1.7.4 in Fulton's "Intersection Theory", asserting that if a morphism of schemes (of finite type over a field) $f:X\to Y$ is flat and finite of degree $d$, then for every subvariety $V\subset Y$ one has $f_\ast f^\ast[V]=d[V]$. My calculation leads to the equality \begin{equation} f_\ast f^\ast[V]=\sum_{W\subset f^{-1}(V)}n_W\deg(W/f(W))[f(W)], \end{equation} where the sum is on the irreducible components $W$ of $f^{-1}(V)$ and $n_W=\ell(\mathscr O_{f^{-1}(V),W})$. Because $f^{-1}(V)\to V$ is flat and $V$ is irreducible, every $W$ dominates $V$. But as $f$ is finite (hence closed) we get $f(W)=V$ for all $W$, so we can write \begin{equation} f_\ast f^\ast[V]=\sum_{W\subset f^{-1}(V)}n_W\deg(W/V)[V]. \end{equation} Now, we are left to show that $\sum_Wn_W\deg(W/V)=d$. I know that if I have a local ring $A$ and an $A$-algebra $B\cong A^d$, then $d=\sum_{\mathfrak n\in\textrm{Spm}\,B}[B_\mathfrak n/\mathfrak nB_\mathfrak n:A/\mathfrak m_A]\ell_{B_\mathfrak n}(B_\mathfrak n/\mathfrak m_AB_\mathfrak n)$. Hence, to conclude I'd like to take $A=\mathscr O_{Y,V}$, but $\textbf{what}$ $B$ $\textbf{do I have to choose?}$ I'd like to interpret $n_W$ as the length appearing in the sum (so I need a correspondence $\mathfrak n\leftrightarrow W$) and to recover $\deg(W/V):=[R(W):R(V)]$ as the degree $[B_\mathfrak n/\mathfrak nB_\mathfrak n:A/\mathfrak m_A]$.
Also, can you show me an $\textbf{example}$ of this result?
Thank you in advance.