Simply it as follows:
1 + 39 = 40
2 + 38 = 40 etc
18 + 22 = 40
19 + 21 = 40
There are 19 of these plus 40 itself . . .therefore 20 of them
20 x 40 = 800
And finally the last number not used, 20
Therefore 800 + 20 = 820
The number of girls is 9 :) you add the two ratio numbers to equal 5 you then divide the 15 children by the ratio of 5, which is 3. you then times 2x3 and 3x3 to get the boy and the girls numbers which are 6 &9 so the number of girls is 9