N,L=map(int,input().split()) S=[1 for i in range(2*10**6+1)] S[0]=0 S[1]=0 for i in range(2,2*10**6): if S[i]==1: for j in range(2,2*10**6): if i*j>len(S)-1: break else: S[i*j]=0 #print(S[:6]) ans=0 for i in range(L): if S[i]==1: if (N-1)*i<=L: ans+=(L-(N-1)*i+1) else: break print(ans)