Charge fraction of 6.0 MeV/n heavy ions with a carbon foil: Dependence on the foil thickness and projectile atomic number