#define PROBLEM "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2858"
#include<bits/stdc++.h>usingnamespacestd;#include"../../utilities/shifted_array.hpp"constexprlonglongMAX=100000;longlongsolve(longlongl,longlongr){vector<char>is_prime(MAX,1);is_prime[0]=is_prime[1]=0;m1une::shifted_array<vector<longlong>>prime_factors(l,r);for(longlongp=2;p*p<=r;++p){if(!is_prime[p])continue;for(longlongx=2*p;x<MAX;x+=p){is_prime[x]=0;}for(longlongx=(l+p-1)/p*p;x<=r;x+=p){prime_factors[x].emplace_back(p);}}longlongres=0;for(longlongx=l;x<=r;++x){longlongfactor_count=0;longlongy=x;for(longlongp:prime_factors[x]){while(y%p==0){y/=p;++factor_count;}}if(y>1){++factor_count;}if(is_prime[factor_count]){++res;}}returnres;}intmain(){longlongl,r;cin>>l>>r;cout<<solve(l,r)<<endl;}
#line 1 "verify/unit_test/shifted_array.test.cpp"
#define PROBLEM "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2858"
#include<bits/stdc++.h>usingnamespacestd;#line 1 "utilities/shifted_array.hpp"
#line 6 "utilities/shifted_array.hpp"
namespacem1une{// bool is not allowed// if you want to use bool, use char insteadtemplate<typenameT>structshifted_array{private:longlong_offset;longlong_step;int_size;std::vector<T>_data;public:// make an array with indices from L to R (including both L and R)// [L, R] (closed interval)shifted_array(longlongL,longlongR,Tinit_value=T(),longlongstep=1):_offset(L),_step(step),_size((R-L)/step+1),_data(_size,init_value){if(step<=0){throwstd::invalid_argument("Step must be positive");}if(L>R){throwstd::invalid_argument("Left bound must be less than or equal to right bound");}}T&operator[](longlongi){intindex=(i-_offset)/_step;if(index<0||index>=_size){throwstd::out_of_range("Index out of range");}return_data[index];};constT&operator[](longlongi)const{intindex=(i-_offset)/_step;if(index<0||index>=_size){throwstd::out_of_range("Index out of range");}return_data[index];};longlongindex(longlongi)const{intindex=(i-_offset)/_step;if(index<0||index>=_size){throwstd::out_of_range("Index out of range");}returnindex;}};}// namespace m1une#line 7 "verify/unit_test/shifted_array.test.cpp"
constexprlonglongMAX=100000;longlongsolve(longlongl,longlongr){vector<char>is_prime(MAX,1);is_prime[0]=is_prime[1]=0;m1une::shifted_array<vector<longlong>>prime_factors(l,r);for(longlongp=2;p*p<=r;++p){if(!is_prime[p])continue;for(longlongx=2*p;x<MAX;x+=p){is_prime[x]=0;}for(longlongx=(l+p-1)/p*p;x<=r;x+=p){prime_factors[x].emplace_back(p);}}longlongres=0;for(longlongx=l;x<=r;++x){longlongfactor_count=0;longlongy=x;for(longlongp:prime_factors[x]){while(y%p==0){y/=p;++factor_count;}}if(y>1){++factor_count;}if(is_prime[factor_count]){++res;}}returnres;}intmain(){longlongl,r;cin>>l>>r;cout<<solve(l,r)<<endl;}