A gas contained in a cylinder fitted with a frictionless piston expands against a constant external pressure of 1 atm from a volume of 5 liters to a volume of 10 liters. In doing so it absorbs 400 J of thermal energy from its surroundings. Determine the change in the internal energy of the system.