Brian is taking part in a 34.5 mile endurance program which starts with jogging and ends with biking. He jogs at 5 miles per hour to the location where he chooses up his bike and rides at 18 miles per hour to finish line. Determine amount of time he traveled at each of speeds if the total time for endurance program was 2 hours and 21 minutes?