from math import sqrt N, L = map(int, input().split()) result = 0 max_interval = int(L//(N-1)) primes = set(range(3, max_interval+1, 2)) if max_interval >= 2: primes.add(2) du = primes.difference_update for i in range(3, int(sqrt(max_interval))+1, 2): if i in primes: du(range(i*2, max_interval+1, i)) for x in primes: d = x*(N-1) result += L-d+1 print(result)