TLE,60分
#include <bits/stdc++.h>
using namespace std;
#define int long long
bool pd(int a){
for(int i=0;i<=sqrt(a);i++){
for(int j=0;j<=sqrt(a);j++){
if(pow(2,i)+pow(2,j)==a){
return 1;
}
}
}
return 0;
}
signed main(){
int l,r,s=0;
cin>>l>>r;
for(int i=l;i<=r;i++){
if(pd(i)){
s++;
}
}
cout<<s;
}