def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] def check_pattern(n,p): if 2 <= p <= n+1: num = p-1 elif n+2 <= p <= 2*n: num = 2*n+1-p else: num = 0 return num N,K = int(input()),int(input()) l = list(filter(lambda x: x <= 2*N, make_divisors(K))) count = 0 for i in l: for j in l: if i*j == K: count += check_pattern(N,i)*check_pattern(N,j) break print(count)