A baseball coach purchased a total of 28 helmets and caps. Each helmet cost $21.50, and each cap cost $8.25. If the coach spent a total of $363.50, how many helmets did the coach purchase?