Clumping factors of H II, He II and He III