#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; class Prime { public: vector prime_list; const ll MAX_N = 2000010; Prime() { bool checked[MAX_N + 1]; memset(checked, false, sizeof(checked)); for (ll i = 2; i <= MAX_N; ++i) { if (!checked[i]) { prime_list.push_back(i); for (ll j = i * i; j <= MAX_N; j += i) { checked[j] = true; } } } } map prime_division(ll n) { map res; for (ll i = 0; prime_list[i] <= sqrt(n); ++i) { ll p = prime_list[i]; while (n % p == 0) { ++res[p]; n /= p; } } if (n != 1) { res[n] = 1; } return res; } bool is_prime(ll n) { if (n <= 1) return false; for (int i = 0; i < prime_list.size(); ++i) { if (n % prime_list[i]) return false; } return true; } }; int main() { int L, R; cin >> L >> R; Prime prime; int ans = 0; for (int x : prime.prime_list) { if (x < L) continue; if (x > 2 * R) break; if (x <= R) ans++; if (x > 2 && x / 2 >= L) ans++; } cout << ans << endl; return 0; }