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

Example Input: Problem: joan took out a mortgage from hel local bank . each monthly mortgage payment she makes must be triple the amount of the previous month ' s payment . if her first payment is $ 100 , and the total amount she must pay back is $ 914800 , how many months will it take joan to pay back her mortgage ?
Example Output: 9

Example Input: Problem: line q has the equation 5 y 3 x = 30 . if line s is perpendicular to q , has an integer for its y - intercept , and intersects q in the second quadrant , then how many possible line s ' s exist ? ( note : intersections on one of the axes do not count . )
Example Output: 22

Example Input: Problem: the number of diagonals of a polygon of n sides is given by the formula v = n ( n - 3 ) / 2 . if a polygon has twice as many diagonals as sides , how many sides does it have ?
Example Output:
5