.
It is easy.
From the condition (from the given data), you can restore the placement of the girls and the boys in the row, from left to right.
It is as follows:
G1 G2 G3 B1 G4 G5 G6 B2 G7 G8 G9 G10 G11 G12 G13 G14 G15 B3 G16 G17 G18 B4 G19 G20
Then the number of boys counted by each girl in front of she, is as follows:
G1 G2 G3 G4 G5 G6 G7 G8 G9 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G20
4 4 4 3 3 3 2 2 2 2 2 2 2 2 2 1 1 1 0 0
So, the sum you are looking for is 4*3 + 3*3 + 2*9 + 1*3 + 0*2 = 42.
Now, having this solution before your eyes, it is not difficult to re-tell it in the compact form, by writing
and justifying the last summation immediately, omitting all details that preceed.
Solved, answered, explained and completed.