#include using namespace std; using ll = long long; using uint = unsigned int; using ull = unsigned long long; #define rep(i,n) for(int i=0;i=0;i--) #define per1(i,n) for(int i=int(n);i>0;i--) #define all(c) c.begin(),c.end() #define si(x) int(x.size()) #define pb emplace_back #define fs first #define sc second template using V = vector; template using VV = vector>; template void chmax(T& x, U y){if(x void chmin(T& x, U y){if(y void mkuni(V& v){sort(all(v));v.erase(unique(all(v)),v.end());} template int lwb(const V& v, const T& a){return lower_bound(all(v),a) - v.begin();} template V Vec(size_t a) { return V(a); } template auto Vec(size_t a, Ts... ts) { return V(ts...))>(a, Vec(ts...)); } template ostream& operator<<(ostream& o,const pair &p){ return o<<"("< ostream& operator<<(ostream& o,const vector &vc){ o<<"{"; for(const T& v:vc) o< isp; V pr; V sf; //smallest factor, sf[9*5*11] = 3 void linear_sieve(int X){ // <= X isp = V(X+1,true); isp[0] = isp[1] = false; sf = V(X+1); for(int i=2;i<=X;i++){ if(isp[i]){ pr.pb(i); sf[i] = i; } for(int j=0;i*pr[j]<=X;j++){ isp[i*pr[j]] = false; sf[i*pr[j]] = pr[j]; if(i%pr[j] == 0) break; } } } const ll X = 1000010; ll f[X]; bool sq[X]; int main(){ cin.tie(0); ios::sync_with_stdio(false); //DON'T USE scanf/printf/puts !! cout << fixed << setprecision(20); linear_sieve(X); ll L,R; cin >> L >> R; rep(i,R-L+1){ f[i] = L+i; } for(ll p: pr){ for(ll x=(L+p-1)/p*p; x<=R; x+=p){ f[x-L] /= p; while(f[x-L]%p == 0){ f[x-L] /= p; sq[x-L] = true; } } } ll ans = 0; rep(i,R-L+1){ if(f[i] > 1){ ll r = sqrtl(f[i]); if(r*r == f[i]) sq[i] = true; } if(!sq[i]) ans++; } cout << ans << endl; }