Imagine that the class only had 4 students (unrealistic most likely, but small numbers help much better I think)
If we had 4 students and 3 were boys, then 4-3 = 1 girl is in the class. This makes the ratio of boys to girls be 3 to 1. In other words, there are 3 times as many boys compared to girls.
Divide the number of girls (1) over the number of students total (4) to get 1/4 = 0.25 = 25%
You start with 14, and add on 6 which gives you your starting total 20. So that's one hour. then you add another hour, adding on another $6 making the total $26 and two hours of renting time.