Pion multiplicity as a probe of the deconfinement transition in heavy-ion collisions