def enumerate_primes(n): result = [] sieve = list(range(max(n + 1, 2))) if n < 2: return result result.append(2) for i in range(4, n + 1, 2): sieve[i] = 2 for i in range(3, int(n ** 0.5) + 1, 2): if sieve[i] != i: continue result.append(i) for j in range(i * i, n + 1, i * 2): if sieve[j] == j: sieve[j] = i return result def main(): N, L = map(int, input().split()) t = L // (N - 1) result = 0 for d in enumerate_primes(t): result += L - d * (N - 1) + 1 print(result) main()