Roy bought a new hybrid car and took it on a trip. For the first 50 miles, the car ran exclusively on its battery. For the rest of the trip, it used gasoline at a rate of 0.03 gallons per mile. Overall, the car averaged 50 miles per gallon for the entire trip. What was the total length of the trip in miles?