Instructions: The task is to generate the correct answer for a given math problem.
Input: Problem: two trains , a and b , started simultaneously from opposite ends of a 125 - mile route and traveled toward each other on parallel tracks . train a , traveling at a constant rate , completed the 125 - mile trip in 12 hours ; train b , traveling at a constant rate , completed the 125 - mile trip in 8 hours . how many miles had train a traveled when it met train b ?
Output:
5