A system initially has an internal energy U of 504 J. It undergoes a process during which it releases 111 J of heat energy to the surroundings, and does work of 222 J. What is the final energy of the system, in J?