#include<iostream>
#include<algorithm>
using namespace std;
const int N = 100000+5;
int a[N];
void init()
{
for(int i=0; i<N; i++){
a[i] = 2*i+1;
}
}
int l, r;
void dfs(int start, int end, int cnt){
int k = start;
int t = a[start];
for(int i = start; i < end; ++i)
if((i+1) % t != 0)//因为数组a下标是从0开始的
{
a[k] = a[i]; //只更新 0-end之间的数
k++;
}
if(t < end){
if(t > l)
cnt++;
dfs(start+1, end, cnt); //递归查找
}
else{
cout << cnt << endl;
return;
} //返回数组
}
int main()
{
init();//初始化必须直接为奇数,不然在dfs中,cnt会不正确
cin >> l >> r;
dfs(0, r, 0);//因为数组下标从0开始,故start为0
return 0;
}
//本来想用STL的set打个表判断解下....然后 ,,,可能由于不熟陷入了死循环,一直不能输入,,等以后有机会了改正吧
#include<iostream>
#include<string.h>
#include<set>
using namespace std;
const int N = 1000+5;
//typedef pair<int, bool> PII;
//typedef make_pair(int a, bool b) Mk_PII(a, b);
set<int> a;
int PreSum[N];
void init()
{
for(int i=1; i<N; i++){
a.insert(i);
}
}
void copy(set<int> &b, set<int> a){
b.clear();
for(set<int>::iterator it = a.begin(); it != a.end(); it++)
b.insert(*it);
}
void settable()
{
PreSum[0] = 0;
for(set<int>::iterator it1 = a.begin(); it1 != a.end(); it1++){
int tmp = *it1, cnt = tmp+1;
if(tmp == 1){
continue;
}
// cout << tmp << endl;
set<int> b;
copy(b, a);
for(set<int>::iterator it = a.begin(); it != a.end(); ++it){
// cout << *it << endl;
// cout <<cnt << endl;
if(cnt%tmp == 0){
// cout << *it << endl;
b.erase(*it);
}
cnt ++;
}
copy(a, b);
}
for(set<int>::iterator it = a.begin(); it != a.end(); it++){
PreSum[*it] = PreSum[*(--it)]+1;
cout << PreSum[*it] << endl;
it++;
}
}
int main()
{
init();
settable();//提前打表
//int n;
//cin >> n;
//for(int i=0; i<n; i++)
{
int l, r;
cin >> l >>r;
cout << PreSum[r] - PreSum[l] << endl;
}
return 0;
}