A car traveled for a total of 342 miles over the course of 6 hours on two highways. On the first highway, the car traveled at an average speed of 69 miles per hour. On the second highway, it traveled at an average speed of 51 miles per hour. For how many hours was the car on the second highway?