#include <bits/stdc++.h>
using namespace std;
long long mu(long long x, long long y) {
  long long ans = 1;
  for (long long i = 1; i <= y; i++) ans *= x;
  return ans;
}
int main() {
  long long a, b, i, j, ans = 0;
  cin >> a >> b;
  long long temp = 0;
  for (i = 0; i <= 63; i++) {
    temp += mu(2, i);
    long long x = temp;
    x *= 2;
    if (a <= x && x <= b) ans++;
    for (j = i + 2; j <= 63; j++) {
      x = x * 2 + 1;
      if (a <= x && x <= b) ans++;
    }
  }
  cout << ans;
}
