A school takes delivery of some boxes of balls. In each bos, there are 5 red balls and 3 blue balls. In the whole delivery, there are 40 red balls. How many balls are there altogether?​