For the sake of contradiction, assume that $2$ classrooms have different number of students.
Let the classrooms be $A,B$ and let the number of students in $A$ be $a$ and the number if students in $B$ be $b$.
Without loss of generality, $a>b$.
For each student in $A$, there is one student in $B$ such that they know each other. Using Pigeon Hole Principle, there are $2$ students in $A$ such that they know the same person from $B$.
So, $B$ knows $2$ person from $A$. This contradicts the fact that each student knows exactly one student from each classroom. Hence, it is proved that all classroom has equal number of students.