Let $f:X \to Y$ be a projective morphism between smooth projective varieties over $\mathbb{C}$. Under what condition on $f$ can we conclude that the degree of $X$ is equal to the degree of $Y$ added to the degree of the generic fiber of $f$?