An oxygen atom alone will have 6 valence electrons (outermost electrons). A hydrogen atom each has 1 electron in its outermost shell to share with the oxygen. For oxygen to have a filled outer shell, it will take one electron from each of the two hydrogens into it's outer shell. This means, the number of electrons in its valence shell will be the original amount of electrons oxygen has by itself plus 1 electron from each hydrogen atom. This will form a water molecule [tex]H_2O[/tex]