2. (8 points) Rongrong transferred from Class 1 to Class 2, and Leilei transferred from Class 2 to Class 1. As a result, the average height of students in Class 1 increased by 2 cm, and the average height of students in Class 2 decreased by 3 cm. If Leilei's height is 158 cm and Rongrong's height is 140 cm, then the total number of students in the two classes is $\qquad$ people.
【Solution】Solution: $158-140=18$ (cm),
$$
\begin{array}{l}
18 \div 2+18 \div 3 \\
=9+6 \\
=15 \text { (people) }
\end{array}
$$

Answer: The two classes have a total of 15 students.
Therefore, the answer is: 15.