Answer:
18
Step-by-step explanation:
8CO₂ + 18H₂O + energy ⟶ 3C₆H₁₂O₆ + O₂
C is balanced .
We have 54 O on the left-hand side, but only 20 O on the right-hand side.
We need 34 more O atoms on the right, for a total of 36. Put an 18 in front of O₂.
18CO₂ + 18H₂O + energy ⟶ 3C₆H₁₂O₆ + 18O₂
Check:

It checks.