Determination of partial atomic charges from ab initio molecular electrostatic potentials. Application to formamide, methanol, and formic acid