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

The store lost 14*2.50 = $<<14*2.50=35>>35 because of the malfunctioning refrigerator.

The store earns 3.92-2.50 = $<<3.92-2.50=1.42>>1.42 per remaining half gallon of milk.
They sold 64.40/1.42 = <<64.40/1.42=45.352112676056336>>45 remaining half gallons.
Thus, the store originally bought 45+14 = <<45+14=59>>59 half gallons of milk. Answer: \boxed{59}.