#include <bits/stdc++.h>
using namespace std;
int go(long long a, long long b, int k) {
  long long temp = 1;
  temp <<= k;
  long long t = 1;
  temp -= 2;
  int res = 0;
  while (temp - t > 0) {
    if (temp >= a && temp <= b) res++;
    temp -= t;
    t *= 2;
  }
  return res;
}
int main() {
  long long a, b;
  cin >> a >> b;
  int res = 0;
  for (int i = 0; i < 62; i++) res += go(a, b, i);
  cout << res << endl;
  return 0;
}
