Let's consider a table consisting of *n* rows and *n* columns. The cell located at the intersection of *i*-th row and *j*-th column contains number *i* × *j*. The rows and columns are numbered starting from 1.

You are given a positive integer *x*. Your task is to count the number of cells in a table that contain number *x*.
The single line contains numbers *n* and *x* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *x* ≤ 10<sup class="upper-index">9</sup>) — the size of the table and the number that we are looking for in the table.
#  author:  violist
#  created: 26.05.2022 15:17:34

import sys
from math import gcd
input = sys.stdin.readline

def factorization(n):
    def get_factor(n):
        x_fixed = 2
        cycle_size = 2
        x = 2
        factor = 1
        while (factor == 1):
            for count in range(cycle_size):
                if factor > 1: break
                x = (x * x + 1) % n
                factor = gcd(x - x_fixed, n)
            cycle_size *= 2
            x_fixed = x
        return factor
    factors = []
    while (n > 1):
        nxt = get_factor(n)
        factors.append(nxt)
        n //= nxt
    return factors

n, x = map(int, input().split())
factors = factorization(x)
ans = 0
for i in factors:
    if (i <= n):
        ans += 2
print(ans)
