q1 = heat evolved in moving steam from 145 to 100.
q1 = mass steam x specific heat steam x (Tfinal-Tinital) where Tfinal is 100 and Tinitial is 145.
q2 = heat evolved when steam at 100 C condenses to liquid at 100 C.
q2 = mass x heat vaporization
q3 = heat evolved in moving water from 100 C to zero.
q3 = mass water x specific heat water x (Tfinal-Tinitial) where T final is zero and Tinitial is 100.
q4 = heat evolved on freezing water at zero to ice at zero.
q4 = mass water x heat fusion.
q5 = heat evolved in moving ice from zero to -50.
q5 = mass ice x specific heat ice x (Tfinal-Tinitial) where Tfinal is -50 and Tinitial is zero.
Total Q = q1+q2+q3+q4+q5