#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
int main() {
  long long a, b;
  cin >> a >> b;
  int ans = 0;
  for (int h = 1; h < 64; ++h) {
    for (int o = 0; o < h; ++o) {
      long long num = 0;
      for (int i = 0; i < (int)64; ++i) {
        if (i <= h && i != o) {
          num |= 1ll << i;
        }
      }
      ans += (a <= num && num <= b);
    }
  }
  cout << ans << endl;
  return 0;
}
