import math def main(): import sys input = sys.stdin.read().split() N = int(input[0]) K = int(input[1]) res = 0 max_i = int(math.isqrt(K)) for i in range(1, max_i + 1): if K % i != 0: continue j = K // i candidates = [i, j] if i != j else [i] for s in candidates: if s < 2 or s > 2 * N: continue t = K // s if t < 2 or t > 2 * N: continue # Calculate count for s = a + c low_s = max(1, s - N) high_s = min(s - 1, N) cnt_s = 0 if low_s <= high_s: cnt_s = high_s - low_s + 1 # Calculate count for t = b + d low_t = max(1, t - N) high_t = min(t - 1, N) cnt_t = 0 if low_t <= high_t: cnt_t = high_t - low_t + 1 res += cnt_s * cnt_t print(res) if __name__ == '__main__': main()