#include <bits/stdc++.h>
using namespace std;
const int MAX = 64;
set<long long> s;
set<long long>::iterator it;
long long my_pow(long long x, long long n) {
  long long sum = 1;
  for (long long i = 0; i < n; i++) sum *= x;
  return sum;
}
void Is_solved() {
  for (long long i = 2; i < MAX; i++) {
    long long tmp = my_pow(2, i);
    for (long long j = 0; j < i - 1; j++) {
      s.insert(tmp - (my_pow(2, j) + 1));
    }
  }
}
int main() {
  long long Left, Right, ans, sum;
  Is_solved();
  while (cin >> Left >> Right) {
    sum = 0;
    for (it = s.begin(); it != s.end(); it++) {
      ans = *it;
      if (ans >= Left && ans <= Right) sum++;
    }
    cout << sum << endl;
  }
  return 0;
}
