Answer:
Firstly, we need know that:
Energy of a opposite reaction will equal to = (-) energy of forward reaction.
Therefore,
H2(g) +1/2 O2(g) -------------> H2O (g)    ΔfG = -237.13 kJ/mol -----------(1)
ATP + H2O (l) ................. ...........> ADP + Pi   ΔG = -31 kJ/mol   -----------(2)
The first equation can be written as:
H2O -------------------------> H2 +1/2 O2   ΔG = 237.13 kJ/mol -------------(3)
Equation (3) showed the formation of one mole of H2 gas required energy = 237.13 kJ/mol
Equation (2) showed that one mole of ATP on hydrolysis produces energy = 31.0 kJ/mol
Therefore, to get one mole of H2 gas means:
no of moles of ATP required = energy required for H2 production/energy produced by ATP  
= 237.13/31.00
= 7.65 moles
Therefore,  to produce one mole H2 gas = 7.65 moles of ATP is required
So in order to produce 3 moles of H2 
= x ATP required for one mole
= 3 x 7.649 
= 22.947 moles
Therefore, to produce three mole of H2 = 22.9 moles of ATP.