n = int(input()) k = int(input()) r = int(k**(1/2)) c = 0 for i in range(2, min(2*n, r)+1): if k%i == 0 <= 2*n-k//i: c += 2*min(i-1, 2*n-i+1)*min(k//i-1, 2*n-k//i+1) if k**(1/2) == r <= 2*n: c -= min(r-1, 2*n-r+1)**2 print(c)