Suppose there are x boys, then we can see that the white helmet and the red helmet are the same, except for himself, which proves that there are x- 1 girls.
Then the helmets that girls see are X boys and x-2 girls.
x=2(x-2)
x=4
Four boys and three girls.
I hope it helps you, O(∩_∩)O~