#include <bits/stdc++.h>
using namespace std;
long long INF = 10000000000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  unsigned long long x, y;
  cin >> x >> y;
  vector<unsigned long long> v;
  for (int i = 2; i < 65; ++i) {
    string s = "";
    for (int j = 0; j < i; ++j) {
      s += "1";
    }
    for (int j = 1; j < i; ++j) {
      string temp = s;
      temp[j] = '0';
      unsigned long long deci = strtoll(temp.c_str(), NULL, 2);
      v.push_back(deci);
    }
  }
  long long ans = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    if (v[i] >= x && v[i] <= y) ans++;
  }
  cout << ans;
  return 0;
}
