A car traveled a total distance of 350 miles in two parts. For the first hours, the car's average speed was 60 miles per hour. For the remaining hours, the car's average speed was 40 miles per hour. If the time spent on the first part of the trip was 1 hour less than the time spent on the second part, what was the total time, in hours, of the car's trip?