A school bought several pairs of skis, each costing $40 and several pairs of skates, each costing $50. The cost of the whole purchase was $600. How many pairs of skates were purchased if there were 3 more pairs of skates than pairs of skis?