Problem 8.5. At the ball, ladies and gentlemen arrived - in total less than 50 people. During the first dance, only a quarter of the ladies were not invited to dance, and 2/7 of the total number of gentlemen did not invite anyone. How many people came to the ball? (For the dance, a certain gentleman invites a certain lady.)
Answer: 41.

Solution. Let the number of ladies be $n$, and the number of gentlemen be $m$. We will count the number of pairs who danced. On one hand, it is $\frac{3}{4} n$, and on the other hand, $\frac{5}{7} m$. By equating, we find the ratio

$$
\frac{n}{m}=\frac{20}{21}
$$

Since the fraction on the right side is irreducible, we get that $n=20 k$ and $m=21 k$ for some natural number $k$. It remains to note that the total number of people $20 k +$ $21 k=41 k$ is less than 50, so only $k=1$ fits, and the total number of people at the ball is $20+21=41$.