#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long num, i, j, a, b, counter = 0;
  vector<unsigned long long> v;
  queue<unsigned long long> temp;
  temp.push(2);
  v.push_back(2);
  for (i = 4; i <= 1000000000000000000; i = i << 1) {
    int si = temp.size();
    v.push_back(i + ((i / 2) - 1));
    for (j = 0; j < si; j++) {
      unsigned long long save = temp.front();
      temp.pop();
      v.push_back(i + save);
      temp.push(i + save);
    }
    temp.push(i + (i / 2) - 1);
  }
  sort(v.begin(), v.end());
  cin >> a >> b;
  for (i = 0; i < v.size(); i++) {
    if (v[i] >= a && v[i] <= b) counter++;
  }
  cout << counter << endl;
}
