#include <bits/stdc++.h>
const int maxn = (int)1e6;
const int mod = (int)1e9 + 7;
using namespace std;
unsigned long long a, b, cnt;
int main() {
  vector<unsigned long long> v{1};
  cin >> a >> b;
  while (v.back() < 5e18) {
    v.push_back(v.back() * 2);
  }
  for (int i = 2; i < ((int)(v).size()); i++) {
    for (int j = 0; j < i - 1; j++) {
      unsigned long long res = v[i] - v[j] - 1;
      if (res >= a && res <= b) cnt++;
    }
  }
  printf("%I64d", cnt);
  return 0;
}
