#include #include using namespace std; using namespace atcoder; //#pragma GCC optimize("Ofast") #define reps(i,s,n) for(int i = s; i < n; i++) #define rep(i,n) reps(i,0,n) #define Rreps(i,n,e) for(int i = n - 1; i >= e; --i) #define Rrep(i,n) Rreps(i,n,0) #define ALL(a) a.begin(), a.end() using ll = long long; using vec = vector; using mat = vector; ll N,M,H,W,Q,K,A,B; string S; using P = pair; using tp = tuple; const ll INF = (1LL<<60); template bool chmin(T &a, const T b){ if(a > b) {a = b; return true;} else return false; } template bool chmax(T &a, const T b){ if(a < b) {a = b; return true;} else return false; } template void my_printv(std::vector v,bool endline = true){ if(!v.empty()){ for(std::size_t i{}; i; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll L, R; cin>>L>>R; ++R; bitset<1000000> cop(0), nsf(0); vec a(R - L); for(ll i = L; i < R; ++i) a[i - L] = i; for(ll i = 2; i < 1000000; ++i){ if(!cop[i]){ for(int j = i * 2; j < 1000000; j += i) cop[j] = true; for(ll x = ((L + i - 1) / i) * i; x < R; x += i){ assert(a[x - L] % i == 0); if((a[x - L] /= i) % i == 0) nsf[x - L] = true; } } } auto is_square = [](ll x) -> bool{ if(x == 1) return false; ll lb = 0, ub = x + 1; while(ub - lb > 1){ ll cen = lb + (ub - lb) / 2; if(INF / cen > cen && cen * cen <= x){ lb = cen; }else{ ub = cen; } } return x == lb * lb; }; rep(i, R - L) { if(!nsf[i]) nsf[i] = is_square(a[i]); } ll res = R - L; rep(i, 1000000) if(nsf[i]) --res; cout<