The ratio of boys and girls in a class is 3:4. When three boys are absent the ratio changes to 5:8. How many pupils are in the class altogether?

b/g = 3/4

(b-3)/g = 5/8

b+g = 42