In physics, there is something called translation symmetry, meaning that the fundamental properties of the Universe does not depend on where you are. Out of this symmetry, a phenomena known as momentum arises. In non-relativistic velocities, this is a good approximation.
From your post, I assume that the first car (called car A) hits the second car (car B) from behind. No matter if some kinetic energy is converted to heat energy via friction, the sum of the momentum for car A and the momentum of car B before the impact is the same as the sum of the momentum for car A and the momentum for car B after the impact.
m_{A(before)} v_{A(before)} ~+~ m_{B(before)}v_{B(before)}~ = m_{A(after)} v_{A(after)} ~+~ m_{B(after)} v_{B(after)}
Solve for the velocity for A before the crash if you have access to the other values.