#include #include namespace my{ using namespace std; #define eb emplace_back #define LL(...) ll __VA_ARGS__;lin(__VA_ARGS__) #define FO(n) for(ll ij=n;ij--;) #define FOR(i,...) for(auto[i,i##stop,i##step]=range(0,__VA_ARGS__);i=i##stop;i-=i##step) #define fe(a,i,...) for(auto&&__VA_OPT__([)i __VA_OPT__(,__VA_ARGS__]):a) #define single_testcase void solve();}int main(){my::io();my::solve();}namespace my{ void io(){cin.tie(nullptr)->sync_with_stdio(0);cout<>(istream&i,ulll&x){ull t;i>>t;x=t;return i;} ostream&operator<<(ostream&o,const ulll&x){return(x<10?o:o<>(istream&i,lll&x){ll t;i>>t;x=t;return i;} ostream&operator<<(ostream&o,const lll&x){return o<0?x:-x);} auto range(bool s,ll a,ll b=1e18,ll c=1){if(b==1e18)b=a,(s?b:a)=0;return array{a-s,b,c};} constexpr char nl=10; constexpr char sp=32; constexpr auto square(auto x){return x*x;} auto ceil(auto x,auto y){if(y<0)x=-x,y=-y;return x<=0?x/y:(x-1)/y+1;} templatestruct pair{ A a;B b; pair()=default; pair(A a,B b):a(a),b(b){} pair(const std::pair&p):a(p.first),b(p.second){} auto operator<=>(const pair&)const=default; friend ostream&operator<<(ostream&o,const pair&p){return o<ostream&operator<<(ostream&o,const std::pair&p){return o<concept vectorial=is_base_of_v,V>; templatestruct core_type{using type=T;}; templatestruct core_type{using type=typename core_type::type;}; templateusing core_t=core_type::type; templateistream&operator>>(istream&i,vector&v){fe(v,e)i>>e;return i;} templateostream&operator<<(ostream&o,const vector&v){fe(v,e)o<?nl:sp);return o;} templatestruct vec:vector{ using vector::vector; vec(const vector&v){vector::operator=(v);} vec&operator^=(const vec&u){this->insert(this->end(),u.begin(),u.end());return*this;} vec operator^(const vec&u)const{return vec{*this}^=u;} vec&operator++(){fe(*this,e)++e;return*this;} vec&operator--(){fe(*this,e)--e;return*this;} auto scan(const auto&f)const{pair,bool>r{};fe(*this,e)if constexpr(!vectorial)r.b?f(r.a,e),r:r={e,1};else if(auto s=e.scan(f);s.b)r.b?f(r.a,s.a),r:r=s;return r;} auto sum()const{return scan([](auto&a,const auto&b){a+=b;}).a;} }; templatestruct infinity{ templateconstexpr operator T()const{return numeric_limits::max()*(1-is_negative*2);} templateconstexpr operator T()const{return static_cast(*this);} constexpr operator lll()const{return static_cast(*this);} templateconstexpr bool operator==(T x)const{return static_cast(*this)==x;} constexpr auto operator-()const{return infinity();} }; constexpr infinity oo; void lin(auto&...a){(cin>>...>>a);} templatevoid pp(const auto&...a){ll n=sizeof...(a);((cout<0,c)),...);cout<a;fo(i,l,r)a.eb(i);return a;} uint64_t kth_root_floor(uint64_t a,ll k){ if (k==1)return a; auto is_within=[&](uint32_t x){uint64_t t=1;fo(k)if(__builtin_mul_overflow(t,x,&t))return false;return t<=a;}; uint64_t r=0; of(i,sizeof(uint32_t)*CHAR_BIT)if(is_within(r|(1u<prime_enumerate(ll n){ vecsieve(n/3+1,1); for(ll p=5,d=4,i=1,rn=sqrt_floor(n);p<=rn;p+=d=6-d,i++){ if(!sieve[i])continue; for(ll q=(p*p)/3,r=d*p/3+(d*p%3==2),s=p*2;q<(ll)sieve.size();q+=r=s-r)sieve[q]=0; } vecr{2,3}; for(ll p=5,d=4,i=1;p<=n;p+=d=6-d,i++)if(sieve[i])r.eb(p); while(r.size()&&r.back()>n)r.pop_back(); return r; } single_testcase void solve(){ LL(L,R); auto v=seq(L,R+1); vecis_squarefree(R-L+1,1); fe(prime_enumerate(cbrt_floor(R)),p){ fo(X,ceil(L,p)*p,R/p*p+1,p){ if((X/p)%p==0)is_squarefree[X-L]=0; else v[X-L]/=p; } } fo(X,L,R+1){ if(!is_squarefree[X-L])continue; lll t=v[X-L]; if(t==1)continue; if(square(sqrt_floor(t))==t)is_squarefree[X-L]=0; } pp(is_squarefree.sum()); }}