To start a road trip, a car encountered a traffic jam, traveling a total of m miles after the first hour and a total of m2 miles after the second hour. If the ratio of the distance traveled during the first hour to the distance traveled during the second hour is 1 to 7, how far had the car traveled after 2 hours?