The equation for photosynthesis is
$\ce{6CO2 + 6H2O + Energy -> C6H12O6 + 6O2}$
My confusion rests in the following: during the photolysis (water-splitting) step of the light reactions that occur in Photosystem II, water gets split into 2 H+ ions, 2 electrons (which enter the photosystem), and one Oxygen ion. But if Oxygen ($O_2$) is comprised of two oxygen ions covalently bonded to each other, doesn't this mean that
$\ce{6H2O -> 3O2}$ ?
Could someone please clarify this for me?