https://www.lanqiao.cn/problems/214/learning/
#include<bits/stdc++.h>
using namespace std;
int vis[1000006],m,n,cont;
void dfs(int index,int k){
if(index>k){
return;
}
cont=index;
for(int i=index;i<=k;i++){
if(i%vis[index]) vis[cont++]=vis[i];
}
dfs(index+1,cont-1);
}
int main(){
cin>>m>>n;
for(int i=1;i<=n;i++){
vis[i]=2*i-1;
}
dfs(2,n);
int ans=0;
for(int i=1;i<cont;i++){
if(vis[i]>m&&vis[i]<n) ans++;
}
cout<<ans<<endl;
return 0;
}