Heat energy imparted by calorimeter and water contained in it in cooling from 32°C to 5°C is used in melting ice and then raising the temperature of melted ice from 0°C to 5°C.
From the principle of calorimetiy, if the system is fully insulated then, Heat gained by cold body = Heat lost by hot body.
∴ The mass of ice needed =50 g.