#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)(s); i < (int)(e); ++i) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N, L; cin >> N >> L; int maxi = 10000100; vector isPrime(maxi, true); isPrime[0] = isPrime[1] = false; rep(p, 2, maxi) if (isPrime[p]) { for (int q = p*2; q < maxi; q += p) isPrime[q] = false; } ll ans = 0; rep(p, 2, maxi) if (isPrime[p]) { if (L < p*(N - 1)) break; ans += L - p*(N - 1) + 1; } cout << ans << '\n'; }