The volume of water is S* 12cm.
After being turned upside down, the volume of the part without water in the bottle is S*(28-20)cm.
So the total volume of the bottle is S* 12cm+S*8cm=S*20cm.