Provide your best answer for the following math problem. Give ONLY the answer, no other words or explanation.
For example:

Answer: <most likely answer, as short as possible; not a complete sentence, just the answer!>.

The problem is: sarah is driving to the airport . after driving at 40 miles per hour for one hour , she realizes that if she continues at that same average rate she will be an hour late for her flight . she then travels 50 miles per hour for the rest of the trip , and arrives 30 minutes before her flight departs . how many miles did she drive in all ?
340
350 miles.