Text this: Dynamics of population immunity due to the herd effect in the COVID-19 pandemic