n = int(input()) k = int(input()) kn = [] for i in range(1, int(k**0.5)+1): if k % i == 0: if i != 1 and k//i <= 2*n: kn.append([i, k//i]) z = 0 for i, j in kn: if i == j: print(1) break else: x = 0 y = 0 if 2 <= i <= n+1: x = i - 1 elif n+2 <= i <= 2*n: x = 2*n + 1 - i if 2 <= j <= n+1: y = j - 1 elif n+2 <= j <= 2*n: y = 2*n + 1 - j z += x * y print(z*2)