The number of protons plus neutrons equals the atomic mass, while the atomic number of the element is the number of protons. So when you subtract the atomic mass minus atomic number, you'll get the number of neutrons in the atom. Also, the number of protons equals the number of electrons.
Nitrogen has an atomic number of 7 and atomic mass of 14. So it has 7 protons, 7 neutrons (14-7), and 7 electrons.
Oxygen has 8 as atomic number and about 16 as atomic mass, so it has 8 protons, 8 neutrons, and 8 electrons.