Vasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function *P*(*x*) = *a*<sub class="lower-index">0</sub> + *a*<sub class="lower-index">1</sub>*x*<sup class="upper-index">1</sup> + ... + *a*<sub class="lower-index">*n*</sub>*x*<sup class="upper-index">*n*</sup>. Numbers *a*<sub class="lower-index">*i*</sub> are called coefficients of a polynomial, non-negative integer *n* is called a degree of a polynomial.

Vasya has made a bet with his friends that he can solve any problem with polynomials. They suggested him the problem: "Determine how many polynomials *P*(*x*) exist with integer non-negative coefficients so that <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/022f26a75e278ec50b558954524ca5729e932807.png" style="max-width: 100.0%;max-height: 100.0%;"/>, and <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/0212320a6b840272697461ac14a2563310211a70.png" style="max-width: 100.0%;max-height: 100.0%;"/>, where <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/95310776bcda3053fea9e3a9f129d60508d2d8c1.png" style="max-width: 100.0%;max-height: 100.0%;"/> and *b* are given positive integers"? 

Vasya does not like losing bets, but he has no idea how to solve this task, so please help him to solve the problem.
The input contains three integer positive numbers <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/ae773843333f7d3b00d2c2b7e457ab15d35f2a11.png" style="max-width: 100.0%;max-height: 100.0%;"/> no greater than 10<sup class="upper-index">18</sup>.
t,a,b=list(map(int,input().split()))
if (t,a)==(a,b):
    print(2)
elif t==a:
    print(0)
else:
    #two distinct points
    """
    (t,a) (a,b) (b-a)/(a-t) is the slope is not an integer ==>
    we are cannot have a straight line between them
    """
    if abs(b-a)%abs(a-t)==0 and (b-a)//(a-t)>0:
        print(2)
    elif b==a:
        print(1)