Let $n$ be an integer bounding the degree of the fibres of $X \to S$. By Morphisms, Lemma \ref{morphisms-lemma-base-change-universally-bounded} we see that any base change has degrees of fibres bounded by $n$ also. In particular, all the integers $r$ that occur in the statement of the lemma will be $\leq n$. We will prove the lemma by induction on $n$. The base case is $n = 0$ which is obvious. \medskip\noindent We claim the set of points $s \in S$ with $\deg_{\kappa(s)}(X_s) = n$ is an open subset $S_n \subset S$ and that $X \times_S S_n \to S_n$ is finite locally free of degree $n$. Namely, suppose that $s \in S$ is such a point. Choose an elementary \'etale morphism $(U, u) \to (S, s)$ and a decomposition $U \times_S X = W \amalg V$ as in Lemma \ref{lemma-etale-splits-off-quasi-finite-part}. Since $V \to U$ is finite, flat, and locally of finite presentation, we see that $V \to U$ is finite locally free, see Morphisms, Lemma \ref{morphisms-lemma-finite-flat}. After shrinking $U$ to a smaller neighbourhood of $u$ we may assume $V \to U$ is finite locally free of some degree $d$, see Morphisms, Lemma \ref{morphisms-lemma-finite-locally-free}. As $u \mapsto s$ and $W_u = \emptyset$ we see that $d = n$. Since $n$ is the maximum degree of a fibre we see that $W = \emptyset$! Thus $U \times_S X \to U$ is finite locally free of degree $n$. By Descent, Lemma \ref{descent-lemma-descending-property-finite-locally-free} we conclude that $X \to S$ is finite locally free of degree $n$ over $\Im(U \to S)$ which is an open neighbourhood of $s$ (Morphisms, Lemma \ref{morphisms-lemma-etale-open}). This proves the claim. \medskip\noindent Let $S' = S \setminus S_n$ endowed with the reduced induced scheme structure and set $X' = X \times_S S'$. Note that the degrees of fibres of $X' \to S'$ are universally bounded by $n - 1$. By induction we find a stratification $S' = S_0 \amalg \ldots \amalg S_{n - 1}$ adapted to the morphism $X' \to S'$. We claim that $S = \coprod_{r = 0, \ldots, n} S_r$ works for the morphism $X \to S$. Let $g : T \to S$ be a morphism of schemes and assume that $X \times_S T \to T$ is finite locally free of degree $r$. As remarked above this implies that $r \leq n$. If $r = n$, then it is clear that $T \to S$ factors through $S_n$. If $r < n$, then $g(T) \subset S' = S \setminus S_d$ (set theoretically) hence $T_{red} \to S$ factors through $S'$, see Schemes, Lemma \ref{schemes-lemma-map-into-reduction}. Note that $X \times_S T_{red} \to T_{red}$ is also finite locally free of degree $r$ as a base change. By the universal property of the stratification $S' = \coprod_{r = 0, \ldots, n - 1} S_r$ we see that $g(T) = g(T_{red})$ is contained in $S_r$. Conversely, suppose that we have $g : T \to S$ such that $g(T) \subset S_r$ (set theoretically). If $r = n$, then $g$ factors through $S_n$ and it is clear that $X \times_S T \to T$ is finite locally free of degree $n$ as a base change. If $r < n$, then $X \times_S T \to T$ is a morphism which is separated, flat, and locally of finite presentation, such that the restriction to $T_{red}$ is finite locally free of degree $r$. Since $T_{red} \to T$ is a universal homeomorphism, we conclude that $X \times_S T_{red} \to X \times_S T$ is a universal homeomorphism too and hence $X \times_S T \to T$ is universally closed (as this is true for the finite morphism $X \times_S T_{red} \to T_{red}$). It follows that $X \times_S T \to T$ is finite, for example by Lemma \ref{lemma-characterize-finite}. Then we can use Morphisms, Lemma \ref{morphisms-lemma-finite-flat} to see that $X \times_S T \to T$ is finite locally free. Finally, the degree is $r$ as all the fibres have degree $r$.