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