Properties of atoms in molecules. V. Easy procedure for estimating atomic charges from calculated core-electron energies