Writing the chemical reaction given along with the oxidation number of the atoms involved:
+2−2HgS++1−1HCl++1+5−2HNO3→+1H2+2−1HgCl4++2−2NO+0S++1−2H2O
The oxidation number of S and N have changed.
Hg−2S→0S ⋅⋅⋅(i)+5HNO3→+2NO ⋅⋅⋅(ii)
Increase in oxidation number of S = 2 units per HgS molecule
Decrease in Oxidation number of N = 3 units per HNO3 molecule
Multiplying eq. (i) by 3 and eq. (ii) by 2 as to make increase and decrease equal
3HgS+2HNO3→3S+2NO
Balancing Hg and chlorine,
3HgS+2HNO3+12HCl→3H2HgCl4+3S+2NO
To balance hydrogen and oxygen, 4H2O molecules are added on RHS. Hence, the balanced equation is
3HgS+2HNO3+12HCl→3H2HgCl4+3S+2NO+4H2O
So, a+b+c+d+e+f+g=3+2+12+3+3+2+4=29