A source at a temperature of $500$ $K$ provides $1000$ $kJ$ of heat. The temperature of environment is $27^oC$. The maximum useful work (in $kJ$) that can be obtained from the heat source is _______