An inlet pipe fills a tank at the rate of 5 liters of water a minute. An outlet connected to the tank can empty a full tank in 5 hours. Both the pipes are opened together for 30 minutes and then, the outlet is closed. It took another 36 minutes to fill the tank. Find the capacity of the tank.