Samy and Tim had some money. Samy had 4/5 of what Tim had. They had lunch together at a restaurant and shared the cost of the meal. Tim paid 5/7 of the cost of the meal and had $10 left. Samy used 1/3 of his money to pay for his share. How much did the meal cost?