Equations for numbers of conduction electrons in metals? How to calculate?

I need help understanding these equations from Fundamentals of Physics, 8th, Halliday & Resnick.

The book doesn't use symbols for the equations, which makes them hard to follow.
I understand equation 2 but don't follow the derivation of equation 1 and 3-5.

Thanks for the help.

Quote from the book, chapter Conduction of Electricity in Solids:

How many conduction electrons are there?

The total number of conduction electrons is:

\begin{align*}(\text{number of conduction electrons in sample} )\; =\text{(number of atoms in sample}) \cdot \text{(number of valence electrons per atom)} \tag{1} \end{align*}

The number density $n$ of conduction electrons in a sample is the number of conduction electrons per unit volume: $$n=\frac{{\text{number of conduction electrons in sample}}}{{\text{sample volume} \; V}} \tag{2}$$ We can relate the number of atoms in a sample to various properties of the sample and the material making up the sample with the following:

\begin{align*} \text {(number of atoms in sample)} &=\frac{\text{sample mass} \; M_{\text{sam}}}{\text{atomic mass}} \tag{3}\\ &=\frac{\text{sample mass} \; M_{\text{sam}}}{\text{(molar mass)}\; M)/N_A} \tag{4}\\ &= \frac{( \text{material's density}) \cdot (\text{sample volume} \; V)}{(\text{molar mass} \; M)/ N_A} \tag{5} \end{align*} where the molar mass $M$ is the mas of one mole of the material in the sample and $N_A$ is Avogadro's number.

This question is based on the Drude Model of electrical conduction, which assumes that only the valence electrons contribute to the conduction "sea." I will try to elucidate the meaning of equations 1, 3-5 by using symbols for all the terms.

Equation1 gives us a method to find the total number of conduction electrons in the sample (N). This is equal to the valence electrons number of electrons per atom ($$n_v$$) times the total number of atoms in the sample ($$N^*$$).

So we have: $$N = n_v N^*$$

Equation 2 gives a general method to compute the number density of conduction of conductance electrons: $$n = \frac{\text{number of conduction electrons in sample}}{\text{sample volume}} = \frac{N}{V_{sam}}$$

Equation 3-5 prescribe a method to compute the 'number of atoms in sample' i.e., $$N^*$$

Now $$N^*$$ by the Mole theory is the total mass of the sample divided by the atomic mass of the sample. The atomic mass is the Molar mass divided by the Avogadro number $$N_A$$

$$N^* = \frac{M_{sam}}{A}$$ $$N^* = \frac{M_{sam}* N_A}{\text{Molar Mass}}$$ $$N^* = \frac{(\rho_{sam}V_{sam})* N_A}{\text{Molar Mass (M)}}$$

Combining equations 1-5, we can use the expression of $$N^*$$ in $$n$$

$$n = \frac{N}{V_{sam}} = \frac{n_vN^*}{V_{sam}} = \frac{n_v(\rho_{sam}V_{sam})N_A}{M V_{sam}} = \frac{\rho_{sam}N_An_v}{M}$$

Hope this helps!