Multiplicities of charged pions and charged hadrons from deep-inelastic scattering of muons off an isoscalar target