This problem is very easy to answer. You simply have to look at the subscripts of each element of the compound.
1. For caffeine, which has a molecular formula of C₈H₁₀N₄O₂, it contains 8 atoms of Carbon, 10 atoms of Hydrogen, 4 atoms of Nitrogen and 2 atoms of Oxygen.
2. For Iron(III) Sulfate, which has a molecular formula of Fe₂(SO₄)₃, it contains 2 atoms of Iron, 3 atoms of Sulfur, and 12 atoms of Oxygen.