#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int a[64];
int main() {
  for (int i = 0; i < 63; i++) {
    bool f = false;
    for (int j = 0; j < 63; j++) a[j] = 1;
    a[i] = 0;
    for (int j = 62; j >= 0; j--) {
      if (a[j] == 0) break;
      long long num = 0;
      for (int k = j; k >= 0; k--) {
        num = num * 2 + a[k];
      }
      v.push_back(num);
    }
  }
  sort(v.begin(), v.end());
  long long n, m;
  while (cin >> n >> m) {
    int ans = 0;
    for (int i = 0; i < v.size(); i++) {
      if (v[i] >= n && v[i] <= m) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
