* Well, the maximum number of hydrogen atoms for "c" carbon atoms is 2c+2 (think of the formulae of saturated hydrocarbons such as ethane, propane etc.).
* From this number, subtract the "h" hydrogens that you have.
* Since, like hydrogen, a halogen only forms one bond, then they can be treated as if they are hydrogens, so subtract them as well.
* Oxygen forms two bonds, therefore it has no impact (compare H count for methane, CH4, and methanol, CH3OH).
* Nitrogen forms three bonds. This means for "n" nitrogens, "n" extra hydrogen atoms are needed (compare the H count for methane, CH4, and methyl amine, CH3NH2), therefore, add "n".
* The factor of 0.5 accounts for us counting H atoms, but adding hydrogen, H2 , molecules. OK ?