Help! Will mark brianliest!!

In a heat engine, if 500 J of heat enters the system, and the piston does 300 J of work, what is the final internal (thermal) energy of the system if the initial energy is 1,500 J?

1,300 J

800 J

200 J

1,700 J

Please explain your answer!