#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, long long> mp;
  for (long long i = 2; i <= 62; i++) {
    long long x = (1LL << i) - 1LL;
    for (long j = 0; j < i - 1; j++) {
      long long y = 1LL << j;
      mp[x - y]++;
    }
  }
  map<long long, long long>::iterator it;
  vector<long long> v;
  for (it = mp.begin(); it != mp.end(); it++) {
    long long x = it->first;
    v.push_back(x);
  }
  long long n, m;
  cin >> n >> m;
  int cnt = 0;
  for (auto x : v) {
    if (n <= x && x <= m) cnt++;
  }
  cout << cnt << endl;
}
