$A$ trinitro compound,$1,3,5$-tris-($4$-nitrophenyl)benzene,on complete reaction with an excess of $Sn/HCl$ gives a major product,which on treatment with an excess of $NaNO_2/HCl$ at $0^{\circ} C$ provides $P$ as the product. $P$,upon treatment with excess of $H_2O$ at room temperature,gives the product $Q$. Bromination of $Q$ in aqueous medium furnishes the product $R$. The compound $P$ upon treatment with an excess of phenol under basic conditions gives the product $S$.
The molar mass difference between compounds $Q$ and $R$ is $474 \ g \ mol^{-1}$ and between compounds $P$ and $S$ is $172.5 \ g \ mol^{-1}$.
$(1)$ The number of heteroatoms present in one molecule of $R$ is . . . . .
[Use: Molar mass (in $g \ mol^{-1}$): $H=1, C=12, N=14, O=16, Br=80, Cl=35.5$
Atoms other than $C$ and $H$ are considered as heteroatoms]
$(2)$ The total number of carbon atoms and heteroatoms present in one molecule of $S$ . . . . . .
[Use: Molar mass in $g \ mol^{-1}$]: $H=1, C=12, N=14, O=16, Br=80, Cl=35.5$
Atoms other than $C$ and $H$ are considered as heteroatoms
Give the answer for question $(1)$ and $(2)$.