Kelly walked from home to school. For the first 3 minutes, he was walking at an average speed of 40m/min. When he realized that he was going to be late by 10 minutes, he increased his speed by 10m/min. As a result, he was late by 2 minutes. Find the distance between his home and school.