There are three foam generators in the factory, each of the first two can generate 14 liters of foam in one hour and the third can generate 18 liters in an hour. The three generators start working together at the same time and after one hour and a half one of the first generators stops working and two hours after that the third generator stops working and only one generator is left. If 5 hours after they all started to work the last generator stops working, how many liters of foam were generated?