Angular momentum of the system is conserved. First we find the initial angular momentum (3)
Momentum is conserved, so the initial angular momentum equals the final one. We equate what we got in (3) to the final momentum in (5) after finding the new moment of inertia of the system (4).