The variation of the total brightness of comets with heliocentric distance