Super calculator
Super calculator performs only a single arithmetic operation - multiplication of natural numbers. The upper limit of the range of representations of natural numbers in the calculator is not known. We denote this boundary P. If the result is greater than or equal to the multiplication of P (a·b ≤ P, a, b - factors), the two situations are possible:
The answer is (a·b) mod P .
The answer - a random number in the range of valid values (malfunctioning calculator).
Given the values of the factors (a, b) and result (c). Required to write a program analysis of the calculator, which results in a single number that is generated by the following principle:
0, if c = a·b;
1, if the failure occurred;
the minimum value of P.
Input
The string contains the numbers a, b and c separated by a space, a and b – factors, c – the result.
Output
This file contains a single number.
Note: small Vasya, who dreams of becoming a hacker managed to spy on the length of the line input does not exceed 15.