#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, m;
  cin >> n >> m;
  unsigned long long ans = 0;
  unsigned long long k = floor(log2(n));
  unsigned long long l = ceil(log2(m));
  l++;
  if (l > 64) l = 64;
  for (int i = k; i <= l; i++) {
    unsigned long long z = 0;
    for (long long j = 0; j < i; j++) z += (1ll << j);
    for (long long j = 0; j < i - 1; j++) {
      unsigned long long q = z & (~(1ll << j));
      if (q >= n && q <= m) ans++;
    }
  }
  cout << ans;
  return 0;
}
