Stability of nuclei with respect to proton- neutron ratio