Dynamics of formation of K-hole fractions of sulfur projectiles inside a carbon foil