#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  int count = 0;
  for (int i = 0; (1LL << i) / 2 <= b; i++) {
    for (int j = 0; j < i - 1; j++) {
      long long n = (1LL << i) - 1 - (1LL << j);
      if (a <= n && n <= b) count++;
    }
  }
  cout << count << "\n";
  return 0;
}
