sorry, bit ambiguous there. By total energy, I meant the number you were given for the total work applied.
I would approach this problem like this (there's probably a more elegant way, and if you want to leave the terms algebraic and cancel down etc, that might help. Given a calculator, many people don't find it necessary)
1. use Q=mcT to calculate how much heat one would have to apply to the water to heat it to 0 degrees (i.e T = 10). Call this Q_1 for example
2. use Q = mL to calculate the latent heat that will be required to change the material to a liquid. Call this amount of heat Q_2 perhaps.
3. now, Q_1 + Q_2 is the total heat you have "used" so far. Subtract this from the amount of heat that was applied in total: 4.12E6 - Q_1 - Q_2. Call the remaining amount of heat Q_3
4. finally, work out the temperature change you get from applying this remaining amount of heat Q_3 to the (now liquid) water, starting at 0 degrees.