To determine the total energy needed, we have to add the sensible heat and the latent heat involved. The sensible heat is from the temperature 39.5 C to 0 C and the latent heat would be at 0 C. We calculate as follows:
Energy = 6000 (4.184) (0 - 39.5 ) + 80(4184)(6000) = 2x10^9 J