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 <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/dd2b46f89067e3a9d9987c4263de702dd7518fa7.png" style="max-width: 100.0%;max-height: 100.0%;"/>. A Modular Equation, as Hamed's teacher described, is an equation of the form <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/fc4bae676fb9b7279f0b9e6781d3d2d6abf86586.png" style="max-width: 100.0%;max-height: 100.0%;"/> in which *a* and *b* are two non-negative integers and *x* is a variable. We call a positive integer *x* for which <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/fc4bae676fb9b7279f0b9e6781d3d2d6abf86586.png" style="max-width: 100.0%;max-height: 100.0%;"/> 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 <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/fc4bae676fb9b7279f0b9e6781d3d2d6abf86586.png" style="max-width: 100.0%;max-height: 100.0%;"/> has.
In the only line of the input two space-separated integers *a* and *b* (0 ≤ *a*, *b* ≤ 10<sup class="upper-index">9</sup>) are given.
# TPS
# TPNAME: tp-simple-main
# TPDESC: tp start

import bisect
import functools
import math
import os
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import cmp_to_key, lru_cache, reduce
from heapq import heapify, heappop, heappush, heappushpop, nlargest, nsmallest
from itertools import accumulate, combinations, permutations, chain
from operator import add, iand, ior, itemgetter, mul, xor
from string import ascii_lowercase, ascii_uppercase
from typing import *

BUFSIZE = 4096
inf = float("inf")
INF = 0x3F3F3F3F
if "PyPy" in sys.version:
    import pypyjit

    pypyjit.set_param("max_unroll_recursion=-1")


def I():
    return input()


def IE(arg_num=2):
    try:
        return map(int, input().split())
    except IOError:
        return [None] * arg_num


def II():
    return int(input())


def MII():
    return map(int, input().split())


def LI():
    return list(input().split())


def LII():
    return list(map(int, input().split()))


def GMI():
    return map(lambda x: int(x) - 1, input().split())


def LGMI():
    return list(map(lambda x: int(x) - 1, input().split()))


def LII_1():
    return [0] + LII()


def solve(tid=1):
    a, b = MII()
    if a == b:
        print("infinity")
    else:
        y = a - b
        i = 1
        cnt = 0
        while y // i > b:
            if y // i * i == y:
                # print(f"{i} ok: {y // i}")
                cnt += 1
            i += 1
        print(cnt)


def main():
    t = 1
    # t = II()
    for tid in range(1, t + 1):
        solve(tid)


main()

# TPE
