The task is to generate the correct answer for a given math problem.

Ex Input:
Problem: 5 years ago , paula was 3 times as old as karl . in 6 years , paula will be twice as old as karl . what is the sum of their ages now ?

Ex Output:
54


Ex 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 ?

Ex Output:
5


Ex Input:
Problem: what least number should be subtracted from 1398 so that the remainder when divided by 7 , 9 , and 11 will leave in each case the same remainder 5 ?

Ex Output:

7