The total number of lone-pair of electrons in melamine is
Structure of melamine
A pair of electrons which is not shared with another atom by covalent bond is known as a lone pair.
Nitrogen has five electrons in its valence shell. Hydrogen has one electron in its valence shell. Carbon has four electrons in its valence shell. In the structure of melamine, nitrogen bonds with carbon as well as hydrogen. Nitrogen has thus shared three of its valence electrons in bonding. Thus, nitrogen has two electrons in its valence shell which are not shared in bonding. Thus, each nitrogen has one lone pair of electrons in its valence shell.
There are six nitrogen atoms in the structure of melamine and each nitrogen has one lone pair of electrons (not involved in resonance) in its valence shell. Thus, the total number of lone pairs of electrons in melamine is 6.