#include <bits/stdc++.h>
using namespace std;
int count(long long x) {
  int s = 0, p;
  long long last, num = 2;
  last = p = 1;
  num = 2;
  while (num <= x) {
    s++;
    if (last == 1)
      last = (1LL << p++) + 1;
    else
      last >>= 1;
    num += last;
  }
  return s;
}
int main() {
  long long a, b;
  cin >> a >> b;
  cout << count(b) - count(a - 1);
  return 0;
}
