John and Mary were each paid x dollars in advance to do a certain job together. John worked on the job for 10 hours and Mary worked 2 hours less than John. If Mary gave John y dollars of her payment so that they would have received the same hourly wage, what was the dollar amount, in terms of y, that John was paid in advance?