An empty swimming pool with a capacity of 5,760 gallons is filled by a pipe at the rate of 12 gallons per minute. There is an emptying pipe which, in 9 hours, can empty the pool, which is full. How many hours does it take to fill the pool, which is already half filled, if both the pipes are kept open?