Tom rides the bus part of the way to school and then he walks the rest of the way. He walks five minutes longer than he rides. The whole trip takes 27 minutes. For how many minutes does he walk