Mark is going out to meet his friend at a restaurant. If he rides a bus that travels 30km/h, he will arrive 10 minutes late. He takes a taxi instead that travels 40km/h and arrives there 5 minutes earlier than the appointed time. Find the distance from his house to the restaurant.