# compute degree of a line bundle

I have a proper family of projective curves $X\rightarrow S$ with $S=Spec(k[t])$ where $k$ is a field and $t$ an indeterminate (can assume $k$ alg.closed if you like). Assume that the fiber $X_t$ over $t=0$ is a divisor with 3 smooth irreducible components $X_1,X_2,X_3$ intersecting transversally in a chain, i.e. $X_1$ intersects $X_2$ in one point $P$ and $X_2$ intersects $X_3$ in one point $Q$ with $P\neq Q$. I would like to compute the degree of $\mathcal{O}_X(nX_1+mX_3)|_{X_2}$, where $m,n$ are integers. Does anyone know how to do that?

Thanks

-
We have $$\mathcal O_X(nX_1+mX_3)|_{X_2}=(\mathcal O_X(X_1)|_{X_2})^{\otimes n}\otimes (\mathcal O_X(X_3)|_{X_2})^{\otimes m}.$$ By the transversal intersection hypothesis $\mathcal O_X(X_i)|_{X_j}$ has degree $0$ or $1$ if $i\ne j$ (suppose $k$ algebraically closed here). So the degree you are after is $n+m$.