#include <bits/stdc++.h>
using namespace std;
long long pos(vector<long long> v, long long a) {
  long long low = 0, high = v.size();
  while (high - low > 1) {
    long long mig = (high + low) / 2;
    if (v[mig] <= a)
      low = mig;
    else
      high = mig;
  }
  return low;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  vector<long long> v;
  for (long long t = 1; t <= 62; t++) {
    long long S = (1LL << (t)) - 1LL;
    for (long long p = 0; p < t - 1; p++) {
      v.push_back(S ^ (1LL << p));
    }
  }
  v.push_back(0);
  sort(v.begin(), v.end());
  long long a, b;
  cin >> a >> b;
  --a;
  cout << pos(v, b) - pos(v, a) << endl;
}
