#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  long long l, r;
  cin >> l >> r;
  for (int i = 0; i < 64; ++i) {
    long long lol = (1ll << i) - 1;
    for (int j = 0; j < i - 1; ++j) {
      lol &= ~(1ll << j);
      ans += (l <= lol && lol <= r);
      lol |= (1ll << j);
    }
  }
  cout << ans;
}
