Michael is buying new shirts and pants for school. He bought shirts for $38 each and pants for $38 each. He purchased nine items and spent a total of $222. How many shirts did he buy?