On a past Mathematical Olympiad the maximum possible score on a problem was 5. The average score of boys was 4, the average score of girls was 3.25, and the overall average score was 3.60. Find the total number of participants, knowing that it was in the range from 31 to 50.