The number of Dirac-weighted eigenvalues of Sturm-Liouville equations with integrable potentials and an application to inverse problems