#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ll n, l, max = 0, MAX = 1e7+1; ll ans = 0; cin >> n >> l; vector p(MAX, 1); p[0] = 0; p[1] = 0; for (int i = 2; i < MAX; i++){ for (int j = i*2; j < MAX; j += i){ p[j] = 0; } } max = 2*(n-1); if ((l - max + 1) > 0) ans += (l - max + 1); for (ll i = 3; i*(n-1) < MAX; i+=2){ if (p[i]) { max = i*(n-1); if ((l - max + 1) > 0) ans += (l - max + 1); } } cout << ans << endl; }