Two energy reservoirs are at 20 degrees Celsius and 827 degrees Celsius. A heat engine operating between these reservoirs has 40% of the maximum possible efficiency. How much energy does this engine extract from the hot reservoir to do 3500 J of work?