N = int(input()) K = int(input()) ans = 0 for i in range(1, int(K**0.5) + 1): if K%i == 0: j = K//i if N >= i-1: p = i-1 else: p = max(0, -i+1+2*N) if N >= j-1: q = j-1 else: q = max(0, -j+1+2*N) if i != j: ans += p*q * 2 else: ans += p*q print(ans)