#include using namespace std; map isprime; vector prime; map check; int main(void) { long long int a, b; int count = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; for (long long int i = 2; i <= (long long int)sqrt(b); i++) { if (isprime[i]) { prime.push_back(i); for (long long int j = 2 * i; j <= (long long int)sqrt(b); j += i) { isprime[j] = false; } } } for (int i = 0; i < prime.size(); i++) { long long int x = prime[i] * prime[i]; long long int l = ceil((a - 1) / x + 1) * x; for (long long int j = l; j <= b; j += x) { if (check[(int)(j - a)] == false) { check[(int)(j - a)] = true; count++; } } } cout << (b - a + 1) - count << '\n'; return 0; }