A car traveled at an average rate of 51 miles per hour on one highway. It then traveled at an average rate of 71 miles per hour on a second highway. If the car traveled a total of 508 miles in 8 hours, how many miles were driven on the first highway?