Multiplicities of charged pions and charged hadrons produced in deep-inelastic scattering were measured in three-dimensional bins of the Bjorken scaling variable x, the relative virtual-photon energy y and the relative hadron energy z . Data were obtained by the COMPASS Collaboration using a View the MathML source muon beam and an isoscalar target (6LiD). They cover the kinematic domain in the photon virtuality View the MathML source, 0.004<x<0.4, 0.2<z<0.85 and 0.1<y<0.7. In addition, a leading-order pQCD analysis was performed using the pion multiplicity results to extract quark fragmentation functions.