#include <bits/stdc++.h>
using namespace std;
int cal(long long n) {
  int ans = 0;
  for (int i = 1; i < 64; i++) {
    for (int j = 0; j < i - 1; j++) {
      long long tmp = ((1LL << i) - 1) ^ (1LL << j);
      if (tmp <= n) {
        ans++;
      }
    }
  }
  return ans;
}
int main() {
  long long a, b;
  while (cin >> a >> b) {
    cout << (cal(b) - cal(a - 1)) << endl;
  }
  return 0;
}
