The number of atoms can be found by looking at the subscript of the each atom in the chemical formula and multiplying coffecinent if there is any and if the atoms are enclosed in a bracket then multiply the subscript of each atom inside the bracket by the number which is outside the bracket .
( to understand what is coeffcient and what is subscript look at this example: suppose X CzHy X is the coeffcient and z is the
subcript of C and Y is the subscript of H so, coeffcient is the always the number at the beginning of the molecule or atom and susbcript is the number at the end of the atom symbol in compound or molecule) .
In CH2(NH2)2 there is a no coeffcient so just look at the susbcript(number at the end of the atom's symbol remember when there is no number we assume it is 1 )
C = 1
H = 2
For NH2 first open the bracket by multiplying the number outside the bracket with the subscript of each atom inside the bracket.
N = 1 x 2 = 2
H = 2 x 2 = 4
There are 2 Nitrogen atoms