Collisions

A mass M is attached to a loose spring (spring constant k) and lies on a plane with kinetic friction coefficient \mu.
A bullet (mass m) is fired toward the mass in a velocity v.
How much will the spring contract?