n, l = map(int, input().split()) is_prime = [True for i in range(1000000)] is_prime[0], is_prime[1] = False, False for i in range(2, 1000000): if is_prime[i]: j = 2 * i while j < 1000000: is_prime[j] = False j += i R = [i for i in range(1000000)] pr = list(filter(lambda i: is_prime[i], R)) num = 0 for i in pr: if (n - 1) * i <= l: num += l - (n - 1) * i + 1 print(num)