Pipes A and B can fill a cistern in 20 and 30 minutes and C can empty it in 15 minutes.

If the three are opened and closed one after the other successively for 1 min each in that order, how soon will the cistern be filled?

My answer is 180 min but the books answer is 167 minutes, kindly help.