m,l=map(int,input().split()) n=l//(m-1) L=list(range(n)) P=set() for i in L: if L[i]<2:continue L[::i]=[0]*(n//i+(n%i>0)) P.add(i) c=0 for p in P:c+=l-(m-1)*p+1 print(c)