from collections import defaultdict from math import sqrt def divisor(N): ret = [] for i in range(1,int(sqrt(N))+1): if N % i == 0: ret.append(i) if N // i != i: ret.append(N//i) ret.sort() return ret N = int(input()) K = int(input()) div = divisor(K) cnt = defaultdict(int) for d in div: if d < 2 or N * 2 < d: continue if 2 <= d <= N + 1: cnt[d] = d - 1 else: cnt[d] = N * 2 + 1 - d ans = 0 for ac in div: bd = K // ac ans += cnt[ac] * cnt[bd] print(ans)