import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def SI(): return sys.stdin.readline()[:-1] n,l=MI() lim=l//(n-1)+1 isprime=[True]*(lim+1) ans=0 for d in range(2,lim): if not isprime[d]:continue for j in range(d**2,lim+1,d):isprime[j]=False ans+=l-d*(n-1)+1 print(ans)