For the first 5 hours of a trip, a plane averaged 120 kilometers per hour. For the remainder of the trip, the plane travelled an average speed of 180 kilometers per hour. If the average speed for the entire trip was 170 kilometers per hour, how many hours long was the entire trip?