A fax machine and a printer cost a total of $840. If the printer costs $360 more than the fax machine, how much did the fax machine cost ?