Extremely red galaxies: dust attenuation and classification