At Franky’s surf shop the price of a hat is $17 and the price of a T-shirt is $20 . James spent $282 on 15 items and only purchased T-shirts and hats. How many hats did he buy