#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a, b;
  cin >> a >> b;
  set<unsigned long long> s;
  vector<unsigned long long> v, prev;
  prev.clear();
  for (unsigned long long i = 1; i <= 62; i++) {
    v.clear();
    for (unsigned long long j = 0; j < prev.size(); j++)
      v.push_back((prev[j] << 1) + 1);
    prev.clear();
    for (unsigned long long j = 0; j < v.size(); j++)
      s.insert(v[j]), prev.push_back(v[j]);
    s.insert(((1LL << i) - 1) << 1);
    prev.push_back((((1LL << i) - 1) << 1));
  }
  cout << distance(s.lower_bound(a), s.upper_bound(b));
  return 0;
}
