Answer:
5 Mg (magnesium), 2 N (nitrogen), and 6 O (oxygen) -- total of 13 atoms
There are 45 as 1 mg(NO3)2 = 9 atoms.