#if defined(__GNUC__) && !defined(__clang__) #pragma GCC optimize("O3") #if defined(__x86_64__) || defined(__i386__) #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #endif #endif #include #include #define each(x, v) for (auto&& x : v) #define each2(x, y, v) for (auto&& [x, y] : v) #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(x) begin(x),end(x) #define sz(x) (int)(x).size() using namespace std; using namespace atcoder; using ll=long long; using ull=unsigned long long; using ld=long double; using vll=vector; using vvll=vector; using vi=vector; using vvi=vector; using pll=pair; using pi=pair; // using mint=modint998244353; // using mint=modint1000000007; // using mint2=static_modint<2>; // using mint=LazyMontgomeryModInt<998244353>; // using vm=vector; // using vvm=vector; #line 2 "math/isqrt.hpp" #include using namespace std; // floor(sqrt(n)) を返す (ただし n が負の場合は 0 を返す) long long isqrt(long long n) { if (n <= 0) return 0; long long x = sqrt(n); while ((x + 1) * (x + 1) <= n) x++; while (x * x > n) x--; return x; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll L,R; cin>>L>>R; const ll B=1000000; vi squarefree(R-L+1,1); for(ll a=2;a<=B;++a){ ll s=a*a; for(ll m=(L+s-1)/s;m*s<=R;++m)squarefree[m*s-L]=0; } for(ll b=1;b<=R/((B+1)*(B+1));++b){ ll a=isqrt(R/b); ll x=a*a*b; if(x>=L)squarefree[x-L]=0; } ll ans=0; rep(i,0,sz(squarefree))ans+=squarefree[i]; cout<