On the meadow, there were 45 sheep and several shepherds. After half of the shepherds and a third of the sheep left, the remaining shepherds and sheep together had 126 legs. All the sheep and shepherds had the usual number of legs.

How many shepherds were originally on the meadow?

(L. Hozová)

Hint. How many sheep were left on the meadow after the departure?
After one third of the sheep left, two thirds of the original number remained on the meadow, which is 30 sheep $\left(\frac{2}{3} \cdot 45=30\right)$. These have a total of 120 legs $(30 \cdot 4=120)$.

The shepherds who remained on the meadow had a total of 6 legs $(126-120=6)$, so 3 shepherds remained $(6: 2=3)$. Since half of the shepherds left, there were originally $6(3 \cdot 2=6)$ shepherds.