There were 125 more apples in Box A than in Box B. After the fruit seller transferred 1/5 of the apples from Box A to Box B, Box B had 15 more apples than Box A. How many apples were there in both the boxes?