To solve this problem we simply need to apply the concepts of energy conservation.
Let us break down the problem by the steps suggested by the statement:
For the first step we have to


Where Q is heat absorbed and W the work done


For the second step we have to





Therefore the change in internal energy for entire process is 62J