Self-consistent calculation of the longitudinal NMR for the Balian-Werthamer and Anderson-Brinkman-Morel states of superfluid3He