Monte Carlo calculation of compression and pion multiplicity in relativistic central heavy-ion collisions