Thanks for the A2A.
We can solve this problem by assuming.
If all of the groups are groups of 3, then there will be 33 people.
5 - 3 is 2.
Because we are 14 people behind, there are 14/2 groups of 5.
That is, 7 groups of 5 and therefore, 4 groups of 3.
Cheers!