In Al2(SO4)3, the subscript of three next to the SO4 polyatomic ion refers to the number of that same ion is in this molecule. Since there are four atoms of oxygen in each SO4, indicated by the subscript of four next to the oxygen, and there are three SO4 ions, 4⋅3=12 oxygen atoms present in Al2(SO4)3.