Behavior of the eigenphase sum near a resonance