Quenching of the star formation activity in cluster galaxies