Because each water molecules has two hydrogen atoms, each ammonia molecule has three hydrogen atoms we can do the following to get the total number of hydrogen atoms:
Hydrogen atoms = 2 x (5.00×10^25) + 3 x (9.00×10^24) = 1.27x10^26 H atoms
Hydrogen atoms = 2 x (5.00×10^25) + 3 x (9.00×10^24) = 1.27x10^26 H atoms