Rory is buying nails at a hardware store. If one bag of nails costs $7 and Rory spends $42 total, how many bags of nails does he buy?