N, L = list(map(int, input().strip().split(' '))) ans = 0 NMAX = 10 ** 7 nonprime = [False] * (NMAX + 1) for i in range(3, len(nonprime), 2): if nonprime[i]: continue if i * (N - 1) > L: break ans += L - i * (N - 1) + 1 j = 3 while i * j <= NMAX: nonprime[i * j] = True j += 2 if 2 * (N - 1) <= L: ans += L - 2 * (N - 1) + 1 print(ans)