Remember that when calculating formal charge, you count both electrons in a lone pair but only half of the electrons in a bonding pair. This is why a helpful formula is:
-
formal charge = (# of valence e-) - ("sticks + dots")
For example, in the first compound (the protonated oxygen), the oxygen has one lone pair ("2 dots") and three bonding pairs ("3 sticks"). Oxygen has a valence of 6, so its formal charge in this species is 6 - 5 = 1 or +1.