A grocery store bought milk for $2.70 per gallon and stored it in two refrigerators. During the night, one refrigerator malfunctioned and ruined 13 half gallons. If the remaining milk is sold for $4.04 per half gallon, how many half gallons did the store buy if they made a profit of $62.72?