def make_divisors(n): divisors = [] for i in range(1, int(n ** 0.5) + 1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n // i) return divisors N = int(input()) K = int(input()) def cnt(R): return min(R-1, max(0, R-1 - (R-1-N)*2)) D = make_divisors(K) ans = 0 for d in D: r = K // d ans += cnt(d) * cnt(r) print(ans)