The chemical composition of the Earth (by mass) is:
34.6% Iron
29.5% Oxygen
15.2% Silicon
12.7% Magnesium
2.4% Nickel
1.9% Sulfur
http://seds.lpl.arizona.edu/nineplanets/nineplanets/earth.html
The mass of the Earth is 5.97e24 kg = 5.97e27 g
Therefore the earth contains
2.07e27g Iron
1.76e27g Oxygen
9.1e26g Silicon
7.6e26g Magnesium
1.4e26g Nickel
1.1e26g Sulfur
The molar masses of these elements are:
55.9g Iron
16.0g Oxygen
28.1g Silicon
24.3g Magnesium
58.7g Nickel
32.1g Sulfur
Therefore the number of moles of each of these elements is:
3.7e25 Iron
1.10e26 Oxygen
3.2e25 Silicon
3.1e25 Magnesium
2e24 Nickel
3e24 Sulfur
for a total of 2.15e26 moles. Multiply by Avogadro's number to get number of atoms = 1.3e50 or so.
(what about the earth's atmoshere?)