Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define i modulo j as the remainder of division of i by j and denote it by $i \operatorname{mod} j$. A Modular Equation, as Hamed's teacher described, is an equation of the form $a \operatorname{mod} x = b$ in which a and b are two non-negative integers and x is a variable. We call a positive integer x for which $a \operatorname{mod} x = b$ a solution of our equation.

Hamed didn't pay much attention to the class since he was watching a movie. He only managed to understand the definitions of these equations.

Now he wants to write his math exercises but since he has no idea how to do that, he asked you for help. He has told you all he knows about Modular Equations and asked you to write a program which given two numbers a and b determines how many answers the Modular Equation $a \operatorname{mod} x = b$ has.


-----Input-----

In the only line of the input two space-separated integers a and b (0 ≤ a, b ≤ 10^9) are given.


-----Output-----

If there is an infinite number of answers to our equation, print "infinity" (without the quotes). Otherwise print the number of solutions of the Modular Equation $a \operatorname{mod} x = b$.


-----Examples-----
Input
21 5

Output
2

Input
9435152 272

Output
282

Input
10 10

Output
infinity



-----Note-----

In the first sample the answers of the Modular Equation are 8 and 16 since $21 \operatorname{mod} 8 = 21 \operatorname{mod} 16 = 5$

Difficulty: interview

Starter code:

Solutions:
# fin = open("input.txt")
# a, b = map(int, fin.readline().split())
a, b = list(map(int, input().split()))
a2 = a - b
if a2 == 0:
	print("infinity")
else:
	Count = 0
	i = 1
	while i ** 2 <= a2:
		Count += (a2 % i == 0 and i > b) + (a2 % i == 0 and a2 // i > b and i != a2 // i)
		i += 1
	print(Count)


import math
line = input().split()
a = int(line[0])
b = int(line[1])
if a == 0 and b == 0:
    print("infinity")
elif a == 0:
    print("0")
elif a== b:
    print("infinity")
elif a < b:
    print("0")
else:
    c = a- b;
    out = 0
    cek = [1]
    dum = c
    if dum % 2 == 0:
        cek.append(2)
        while dum % 2 == 0:
            dum /= 2
            for i in range(len(cek)):
                cek.append(cek[i] * 2)
    cek = list(set(cek))
    border = int(math.sqrt(dum))
    for i in range(3,border+1,2):
        if dum % i == 0:
            cek.append(i)
            while dum % i == 0:
                dum /= i
                for j in range(len(cek)):
                    cek.append(cek[j] * i)
    dum = int(dum)
    if dum != 0:
        for j in range(len(cek)):
            cek.append(cek[j] * dum)
    cek = list(set(cek))
    cek.sort()
    for i in cek:
        if i == 0:
            continue
        if c % i == 0:
            result = c / i
            if result <= b:
                break
            out += 1
    print(out)


import math
import collections


def multipliers(x):

    divisors = []
    divisor = 2
    stop = math.sqrt(x)
    while x != 1 and divisor <= stop:

        if x % divisor == 0:

            x //= divisor
            divisors.append(divisor)

        else:

            divisor += 1

    if x != 1:

        divisors.append(x)

    return divisors


def count(muls, bound, viewed = None, x=1):

    viewed = viewed or set()
    for i, mul in enumerate(muls):

        nx = x * mul
        if nx not in viewed:

            viewed.add(nx)
            if nx > bound:

                yield 1

            yield from count(muls[:i] + muls[i + 1:], bound, viewed, nx)


a, b = list(map(int, input().split()))
# a, b = 4, 0
if a == b:

    print("infinity")

elif b > a or a == 0:

    print(0)

elif (a, b) == (1, 0):

    print(1)

else:

    muls = multipliers(a - b)
    r = sum(count(muls, b))
    print(r if b else r + 1)


import itertools
import math

def main():
	a, b = list(map(int, input().split()))

	if a == b:
		print("infinity")
		return
	if a < b:
		print(0)
		return
	a -= b

	n = 0

	for i in range(1, math.ceil(math.sqrt(a))):
		if (a % i == 0):
			n += (i > b) + (a // i > b)

	if math.sqrt(a) % 1 == 0 and math.sqrt(a) > b:
		n += 1

	print(n)

def __starting_point():
	main()

__starting_point()

import math

a, b= [int(i) for i in input().split()]

if a<b: print (0)
else: 
    if a== b: print("infinity")
    else:               #>b and divisors of a
        def FindAllDivisors(x, b):
            y = 1
            ans= []
            while y <= int(math.sqrt(x)):
                #print(y)
                if x % y == 0:
                    #print(x, int(x/y))
                    if y!= int(x/y) :
                        if y>b:
                            ans.append(y)
                        if int(x/y)>b:
                            ans.append(int(x/y))
                    elif y== int(x/y) and y>b:
                        ans.append(y)
                y += 1
            return len(ans)
        print(FindAllDivisors(a-b, b))

a, b = [int(i) for i in input().split()]
o = a - b
sum = 0
l = 1
if o > 0:
    for i in range(1, int(o ** 0.5) + l):
        if o % i == 0:
            if o // i > b and i > b:
                sum += 2
                if i == o // i:
                    sum -= 1
            if (o // i > b and i <= b) or (o // i <= b and i > b):
                sum += 1

if o == 0:
    print('infinity')
else:
    print(sum)

from math import *

a, b = list(map(int, input().split()))
if a == b:
    print('infinity')
    return

t = a - b

def primes_sieve(limit):
    limitn = limit+1
    not_prime = [False] * limitn
    primes = []

    for i in range(2, limitn):
        if not_prime[i]:
            continue
        for f in range(i*2, limitn, i):
            not_prime[f] = True

        primes.append(i)

    return primes

lst = primes_sieve(trunc(sqrt(10**10+7)))

def factorize(n, primes):
    factors = []
    for p in primes:
        if p*p > n: break
        i = 0
        while n % p == 0:
            n //= p
            i+=1
        if i > 0:
            factors.append((p, i));
    if n > 1: factors.append((n, 1))

    return factors
    
def divisors(factors):
    div = [1]
    for (p, r) in factors:
        div = [d * p**e for d in div for e in range(r + 1)]
    return div


dv = divisors(factorize(t, lst))
c = 0
for x in dv:
    if x > b:
        c+=1
print(c)
#print(dv)


# -*- coding: utf-8 -*-
import random

a, b = list(map(int, input().split()))

def sums(s, l, b):
    if s > b:
        p = 1
        for x in l:
            p *= (x[1]+1)
        #print("ok, s=",s,p)
        return p

    if not l:
        #print("malo: ", s)
        return 0
    #print(s, end=" ")

    p = 0
    for i in range(l[0][1]+1):
        p += sums(s * (l[0][0]**i), l[1:], b)
    return p


def naive(a,b):
    if a == b:
        return "infinity"
    else:
        if a < b:
            return 0
        else:
            count = 0
            for x in range(1, a+1):
                if a % x == b:
                    count += 1
            return count


def wise(a, b):
    if a == 1 and b == 0:
        return 1
    if a == b:
        return "infinity"
    else:
        d = a-b
        factors = {}
        i = 2
        while i*i <= d:
            if d % i == 0:
                factors.setdefault(i, 0)
                factors[i] += 1
                d //= i
            else:
                i += 1
        factors.setdefault(d, 0)
        factors[d] += 1

        return sums(1, list(factors.items()), b)
            
#for i in range(10000):
    ##print(i)
    #a, b = map(int, input().split())
    ##a = random.randint(0,100000)
    ##b = random.randint(0,100000)
    #if wise(a, b) != naive(a, b):
        #print("!!!")
    #print(a, b, wise(a, b), naive(a, b))

print(wise(a, b))
        


inp = input().split(' ')
a = int(inp[0])
b = int(inp[1])
diff = a-b
if a == b:
    print('infinity')
elif diff < 0:
    print(0)
else:
    l = []
    out = 1
    for x in range(2,int(diff**(1/2))+1):
        num = 0
        y = diff/x
        while y == int(y):
            num += 1
            diff /= x
            y /= x
        if num != 0:
            l.append([x,num])
            out *= (num + 1)
        if diff < x:
            break
    if diff != 1:
        l.append([int(diff),1])
        out *= 2
    if b == 0:
        print(out)
    else:
        flessb = [1]
        for pair in l:
            newl = []
            for x in flessb:
                y = x
                for exp in range(pair[1]+1):
                    if y<=b:
                        newl.append(y)
                        y *= pair[0]
                    else:
                        break
            flessb = set(newl)
        print(int(out-len(flessb)))



a=input().split(" ")
x1=int(a[0]);
y1=int(a[1]);
a1=x1-y1;
if x1==y1:
 print ("infinity");
else:
 i=1;
 counter=0;
 while i**2<=a1:
  counter+=(a1 % i == 0 and i > y1)+(a1 % i == 0 and a1 // i > y1 and i != a1 // i);
  i+=1;
 print(counter);


a, b = map(int, input().split(' '))
diff = a-b
if a == 0 or b == 0 or diff == 0 or b > a:
    if b > a:
        print(0)
    elif a == 0 and b == 0:
        print("infinity")
    elif a == 0:
        print(0)
    elif b == 0:
        factors = []
        for i in range(1, int(diff ** 0.5) + 1):
            if diff % i == 0:
                factors.append(i)
                factors.append(int(diff/i))
        factors = list(set(factors))
        facts = [i for i in factors if i > b]
        print(len(facts))
    else:
        print("infinity")

else:
    b = b % a
    diff = a-b
    factors = []
    for i in range(1, int(diff ** 0.5) + 1):
        if diff % i == 0:
            factors.append(i)
            factors.append(int(diff/i))
    factors = list(set(factors))
    facts = [i for i in factors if i > b]
    print(len(facts))

a, b = list(map(int, input().split(' ')))
diff = a-b
if a == 0 or b == 0 or diff == 0 or b > a:
    if b > a:
        print(0)
    elif a == 0 and b == 0:
        print("infinity")
    elif a == 0:
        print(0)
    elif b == 0:
        factors = []
        for i in range(1, int(diff ** 0.5) + 1):
            if diff % i == 0:
                factors.append(i)
                factors.append(int(diff/i))
        factors = list(set(factors))
        facts = [i for i in factors if i > b]
        print(len(facts))
    else:
        print("infinity")

else:
    b = b % a
    diff = a-b
    factors = []
    for i in range(1, int(diff ** 0.5) + 1):
        if diff % i == 0:
            factors.append(i)
            factors.append(int(diff/i))
    factors = list(set(factors))
    facts = [i for i in factors if i > b]
    print(len(facts))


from math import floor, sqrt


def main():
    a, b = list(map(int, input().split()))
    if a == b:
        print('infinity')
    elif a < b:
        print(0)
    else:
        res, ab = 0, a - b
        for x in range(1, floor(sqrt(ab)) + 1):
            if not ab % x:
                if x > b:
                    res += 1
                if b * x < ab != x * x:
                    res += 1
        print(res)


def __starting_point():
    main()

__starting_point()

def main2(a,b):
    if a==b:
        print("infinity")
        return
    x = a-b
    if b != 0:
        if x//b == 1:
            print(x//b)
            return
        if x//b <= 0:
            print(0)
            return
    xx=[1]
    loop=2
    while loop<=x:
        if x % loop == 0:
            x //= loop
            xx.extend([loop*j for j in xx if loop*j not in xx])
        else:
            loop += 1
        print(loop,x,xx)
    xx = [k for k in xx if k > b]
    print(len(xx))

def main3(a,b):
    from math import ceil, sqrt
    if a==b:
        print("infinity")
        return
    x = a-b
    if b != 0:
        if x//b == 1:
            print(x//b)
            return
        if x//b <= 0:
            print(0)
            return
    xx = []
    for i in range(b+1,ceil(sqrt(x))):
        if x % i == 0: xx.append(i)
    print(len(xx))
def main(a,b,Test=False):
    from math import ceil, sqrt, floor
    if a==b:
        print("infinity")
        return
    if b>a:
        print("0")
        return
    x = a-b
    ans = 0
    for i in range(1,floor(sqrt(x))+1):
        if x%i == 0:
            if i*i==x:
                ans += i>b
            else:
                ans += (i>b)+(x//i>b)
                if Test: print(i,x//i,ans)
    print(ans)

def test():
    from mxn.timer import Timer, timer
    print()
    main(21,5)
    main(10,10)
    main(0,1000)
    with Timer() as tm:
        main(9435152,272)
    with Timer() as tm:
        main(325508499, 119510657)
    with Timer() as tm:
        main(1000000000, 6)
    main(11,2,Test=0)
    main(15,3,Test=1)
#test()

def main_input():
    a,b = list(map(int,input().split()))
    main(a,b)

def __starting_point():
    main_input()

__starting_point()

tmp = input().split()
a = int(tmp[0])
b = int(tmp[1])
a -= b
if a == 0:
    print("infinity")
else:
    ans = 0
    i = 1
    while i * i < a:
        if a % i == 0:
            if i > b:
                ans += 1
            if a/i > b:
                ans += 1
        i += 1
    if i * i == a and i > b:
        ans += 1
    print(ans)


import math, time

a, b= [int(i) for i in input().split()]
if a<b: print(0)
elif a==b: print("infinity")
else:
    def FindRequiredDivisors(x, b):
        y= 1
        ans= 0
        while y <= int(math.sqrt(x)):
            if x % y == 0:
                if y!= int(x/y) :
                    if y>b:
                        ans+= 1
                    if int(x/y)>b:
                        ans+= 1
                elif y== int(x/y) and y>b:
                    ans+= 1
            y+= 1
        return ans
    print(FindRequiredDivisors(a-b, b))        

a,b=map(int,input().split());
dis=a-b;
if dis==0:
	print("infinity");
else :
	res=0;
	x=1;
	while x**2<=dis:
		if dis%x==0 and x>b:
			res+=1;
		if dis%x==0 and dis//x>b and x**2!=dis:
			res+=1;
		x+=1;
	print(res);

import sys

a, b = list(map(int, input().split()))
dis = a - b
if dis == 0:
    print("infinity")
else:
    res = 0
    x = 1
    while x ** 2 <= dis:
        if dis % x == 0 and x > b:
            res += 1
        if dis % x == 0 and dis // x > b and x ** 2 != dis:
            res += 1
        x += 1
    print(res)


a, b = list(map(int, input().split()))
if a == b:
    print('infinity')
else:
    k, val = 1, 0
    while k * k <= a - b:
        if (a - b) % k == 0:
            val += sum(1 for x in {k, (a - b) // k} if x in range(b + 1, a - b + 1))
        k += 1
    print(val)


a, b = list(map(int, input().split()))
if a == b:
    print('infinity')
else:
    k, val = 1, 0
    while k * k <= a - b:
        if (a - b) % k == 0:
            val += sum(1 for x in {k, (a - b) // k} if x > b)
        k += 1
    print(val)


a, b = list(map(int, input().split()))
k, val = 1, 0
while k * k <= a - b:
    if (a - b) % k == 0:
        val += sum(1 for x in {k, (a - b) // k} if x > b)
    k += 1
print('infinity' if a == b else val)


import sys
a, b = map(int, sys.stdin.readline().split())
if a < b:
  print(0)
elif a == b:
  print('infinity')
else:
  n = a - b
  if n <= b:
    print(0)
  else:
    ans = 0
    i = 1
    while i * i <= n:
      if n % i == 0:
        if i > b: ans += 1
        if n // i > b and n // i != i: ans += 1
      i += 1
    print(ans)

x,y=list(map(int,input().split()))

n=x-y
j=n
c=0
if j<0:
    print(c)
elif j==0:
    print("infinity")
else:
    result_set = set()
    sqrtn = int(n**0.5)
    for i in range(1,sqrtn+1):
        q, r = n/i, n%i
        if r == 0:
            if(q>y):
                result_set.add(q)
            if(i>y):
                result_set.add(i)
            
    print( len(result_set))
    


x = input("").split(" ")
a = int(x[0])
b = int(x[1])
list = []
answer = 0
if a == b:
    print("infinity")
else:
    value = 1
    while value**2 <= a-b:
        if (a-b)%value == 0:
            list.append(value)
            if (value != (a-b)/value):
                list.append((a-b)/value)
        value = value + 1
    for value in list:
        if value > b:
            answer = answer + 1
    
    print(answer)

#!/usr/bin/env python3
import math

a, b = list(map(int,input().split()))
diff = a - b
if diff < 0:
    print(0)
elif diff == 0:
    print("infinity")
else:
    cnt = 0
    for i in range(1, 1 + int(math.sqrt(diff))):
        if diff % i == 0 and i > b:
            cnt += 1
        if diff % i == 0 and diff // i > b and i * i != diff:
            cnt += 1
    print(cnt)