The ratio of the number of cars Ed has to the number of cars Pete has was 5:2 at first. After Ed gave 30 cars to Pete, they had an equal amount of cars each. How many cars did they have altogether?