2. (5 points) On Valentine's Day, every student in the school gave a valentine to every female student. It turned out that the number of valentines was 16 more than the total number of students. How many valentines were given?
Answer: 36

Solution: Let $x, y$ be the number of boys and girls in the school, respectively. According to the condition, $x y=x+y+16$. Then $(x-1)(y-1)=17$. Therefore, the numbers $x-1$ and $y-1$ are 1 and 17. The number of valentines is $2 \cdot 18=36$.