#include #include #include using namespace std; typedef long long ll; ll p[1000010]; int main(){ ll i,j,l,r; cin >> l >> r; vector v; for(i=l;i<=r;i++) v.push_back(i); //v[i] = l + i for(i=2;i<=1000000;i++){ ll ll = (l + i - 1)/i*i; //ll,ll + i,ll + 2*i... for(j=ll;j<=r;j+=i){ if(v[j - l]!=0 && v[j - l]%i==0){ int cnt = 0; while(v[j - l]%i==0){ //cout << v[j - l] << " " << i << endl; v[j - l] /= i; cnt++; } if(cnt>=2) v[j - l] = 0; } } } /*for(i=l;i<=r;i++) cout << i << " "; cout << endl; for(ll x:v) cout << x << " "; cout << endl;*/ int cnt = v.size(); for(ll x:v){ if(x==1) continue; if(x==0) cnt--; else{ ll y = sqrt(x); if(x==y*y) cnt--; } } cout << cnt << endl; }