def divisor_list(N): #約数のリスト if N == 1: return [1] res = [] for i in range(1,N): if i*i >= N: break if N%i == 0: res.append(i) res.append(N//i) if i*i == N: res.append(i) return sorted(res) n = int(input()) k = int(input()) def f(d,n): if d < 0: return 0 r = (d+1) if d >= n: r -= 2*(d-n+1) if d >= 2*n: r += (d-2*n+1) return r ans = 0 for d in divisor_list(k): ans += f(d-2,n)*f(k//d-2,n) print(ans)