N = int(input()) K = int(input()) ans = 0 for i in range(2,int(K**0.5)+1): if K%i == 0: ac = min(i-1,max(0,N*2-i+1)) j = K//i bd = min(j-1,max(0,N*2-j+1)) ans += ac*bd*2 if K**0.5 % 1 == 0: ans -= min(K**0.5-1,max(0,N*2-(K**0.5)+1)) print(ans)