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>.
import bisect
import copy
import decimal
import fractions
import functools
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import degrees, gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

def LCM(n,m):
    if n or m:
        return abs(n)*abs(m)//math.gcd(n,m)
    return 0

def CRT(lst_r,lst_m):
    assert len(lst_r)==len(lst_m)
    if not lst_r:
        return 0,1
    r,m=lst_r[0],lst_m[0]
    for r0,m0 in zip(lst_r[1:],lst_m[1:]):
        if (r0,m0)==(-1,0):
            r,m=-1,0
            break
        r0%=m0
        g=math.gcd(m,m0)
        l=LCM(m,m0)
        if r%g!=r0%g:
            r,m=-1,0
            break
        r,m=(r0+m0*(((r-r0)//g)*Extended_Euclid(m0//g,m//g)[0]%(m//g)))%l,l
    return r,m

def Extended_Euclid(n,m):
    stack=[]
    while m:
        stack.append((n,m))
        n,m=m,n%m
    if n>=0:
        x,y=1,0
    else:
        x,y=-1,0
    for i in range(len(stack)-1,-1,-1):
        n,m=stack[i]
        x,y=y,x-(n//m)*y
    return x,y

mod=10**9+7
def main(a,b,c,d):
    retu=0
    r,m=CRT([b,d],[a,c])
    for rr in range(r,min(b,d)+1,m):
        if rr==0:
            retu+=1
            continue
        else:
            retu+=main(a,(b-r)//rr,c,(d-r)//rr)
    return retu
t,a,b=map(int,readline().split())
if t==a==b==1:
    ans="inf"
else:
    ans=main(t,a,a,b)
print(ans)