Some girls and boys took part in a race. At first, the number of girls was 5/7 of the number of boys. After 10 girls and 32 boys withdrew from the race, the ratio of the number of girls to the number of boys was 5:4.
(a) How many children were there altogether in the end?
(b) How many children were there altogether at first?