def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] n=int(input()) k=int(input()) yakusu=make_divisors(k) comb=[0]*len(yakusu) s=0 for k in range(1,len(yakusu)): if(yakusu[k]<=2*n): comb[k]=yakusu[k]-1-2*max(0,yakusu[k]-n-1) for i in range(len(yakusu)): s+=comb[i]*comb[len(yakusu)-1-i] print(s)