Temperatures in heavy-ion collisions from pion multiplicities