#include<bits/stdc++.h> using namespace std; int main(){ int n,m,t=0;cin>>n>>m; for(int i=n;i<=m;i++){ for(int x=0;x<=sqrt(n);x++){ for(int y=0;y<=sqrt(m);y++){ if(pow(2,x)+pow(2,y)==i){ t++; } } } } cout<<t; }