A thermodynamic system undergoes a process in which its internal energy decreases by 1,477 J. If at the same time 678 J of thermal energy is transferred to it, how much work (in J) is done by the system?