Nick had 87 apples in a box. John took away 50 apples to sell at the market . How many apples did Nick have left?