#include #include using namespace std; using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() const long long MOD = 1000000007; const long long INF = 9*1e18; using ll = long long; using mint = modint1000000007; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b primelist; bool Prime(ll num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; double sqrtNum = sqrt(num); for (ll i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { return false; } } return true; } void primeinput(){ for(ll i = 2;i<1002000;i++){ if(Prime(i)){ primelist.push_back(i); } } } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll L,R; cin>>L>>R; primeinput(); vector A,B; for(ll i = L;i<=R;i++){ A.push_back(i); B.push_back(0); } rep(i,primelist.size()){ ll temp = 0; if(primelist[i] >= L){ temp = primelist[i]-L; } else{ temp = (L%primelist[i]); } while(temp <(R-L)){ ll cnt = 0; while(A[temp]%primelist[i] == 0){ A[temp]/=primelist[i]; cnt++; } if(cnt >= 2){ B[temp] = 1; } temp += primelist[i]; } } /*rep(i,B.size()){ cout << B[i] << " "; } cout << endl;*/ ll ans = 0; rep(i,A.size()){ if(B[i] == 1){ continue; } if(A[i] == 1){ ans++; continue; } ll temp = sqrt(A[i]); //cout << temp << endl; bool d = 0; for(int k = -2;k<=3;k++){ if((temp+k)*(temp+k) == A[i]){ d = 1; } } if(!d){ ans++; } } cout << ans << endl; return 0; }