A group of boys and girls waits at a bus stop. In the first bus that passes, only 15 girls board, and 2 boys remain for each girl at the bus stop. In the second bus that passes, only 45 boys board, and 5 girls remain for each boy at the bus stop. Determine the number of boys and girls that were at the stop before the first bus arrived.
Let's denote by $M$ the number of girls and by $H \circ$ the number of boys who were at the bus stop before the first bus arrived. After 15 girls boarded the first bus, $M-15$ girls and $H$ boys remained at the stop. Since, at this moment, there were 2 boys for every girl left at the stop, we have: $H=2(M-15)$. In the second bus, 45 boys boarded, and $M-15$ girls and $H-45$ boys remained at the stop. Since, at this moment, there were 5 girls for every boy left at the stop, we have: $M-15=5(H-45)$.

Thus, we obtain the linear system

$$
\left\{\begin{array}{l}
H=2(M-15) \\
M-15=5(H-45)
\end{array}\right.
$$

Substituting the first equation into the second, we get: $M-15=5(2 M-30-45)$. Therefore:

$$
375-15=10 M-M \Rightarrow M=40
$$

and $H=2(40-15)=50$.