This does sound like the old "As I was going to St Ives, I met a man with seven wives, and every wife had seven cats, and every cat had seven kits... Kittens, mittens, cats & wives, how many were going to St Ives?"
The answer , of course is '1'. "I was going to St Ives" Those I met were presumably travelling in the opposite direction.
For this question it states that the girls (etc.,) are on the bus, but asks how many legs are in the bus
So depending on whether there is a driver the answer (as far as we are told) is either 2 or 0.