There are 39 more red balls than yellow balls. 2/5 of the balls in a box are red. 5/8 of the remaining balls are blue. The rest of the balls are yellow. How many balls are there altogether?