N,X = map(int,input().split()) ue = 10 ** 5 from functools import lru_cache #@lru_cache(maxsize = 100000) div = [] for i in range(2,ue): if (X + 1) % i == 0: div.append(i) #@lru_cache(maxsize = 100000) t = len(div) def calc(n = N,inf = 0,x = X + 1): if div[inf] > x:return 0 if n == 1: return 1 ans = 0 for i in range(inf,t): u = div[i] if u > x:break if x % u == 0: ans += calc(n - 1,i,x // u) return ans print(calc())