Tony bought 3 boxes of 1-inch nails for a total of 297 1-inch nails and 5 boxes of 2-inch nails that had equal amounts of nails. He bought a total of 577 nails. Find the number of nails in each box of 2-inch nails.