#include <bits/stdc++.h>
using namespace std;
long long power(int x, int y) {
  if (y == 0)
    return 1;
  else
    return power(x, y - 1) * x;
}
int main() {
  set<long long> a;
  set<long long>::iterator it;
  for (int i = 60; i > 0; i--) {
    long long p = power(2, i) - 1;
    for (int j = 1; j < i; j++) {
      a.insert(p - power(2, j - 1));
    }
  }
  long long l, r;
  cin >> l >> r;
  int to = 0;
  for (it = a.begin(); it != a.end(); it++) {
    if (*it >= l && *it <= r) to++;
  }
  cout << to << endl;
}
