N,L = map(int,input().split()) def getPrimes(): isPrime = [True for i in range(1000000 + 1)] isPrime[0] = isPrime[1] = False primes = [] for i in range(2,1000000 + 1): if not isPrime[i]: continue j = 2 while i * j <= 1000000: isPrime[i * j] = False j += 1 primes.append(i) return primes primes = getPrimes() #print(primes) ans = 0 for p in primes: if L < p * (N - 1): break ans += (L - p * (N - 1)) + 1 print(ans)