A school is doing a fundraiser by selling hats and shirts. The number of shirts sold was three times the number of hats. Each shirt cost $5 and each hat cost $2.50. If the students made a profit of $210, how many hats and shirts were sold?