#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> v;
  v.push_back(0);
  long long len, i, z, a, b, c;
  for (len = 2; len <= 60; ++len) {
    z = (1LL << len);
    z--;
    for (i = 0; i < len - 1LL; ++i) v.push_back(z ^ (1LL << i));
  }
  long long ans = 0;
  cin >> a >> b;
  for (i = 0; i < v.size(); ++i)
    if (v[i] >= a && v[i] <= b) ans++;
  cout << ans;
}
