#include <bits/stdc++.h>
using namespace std;
long long int a, b;
long long int ans;
long long int small, big;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin >> a >> b;
  big = log(b) / log(2);
  big++;
  small = log(a) / log(2);
  small++;
  for (__typeof(small) i = small; i < big + 1; i++) {
    for (__typeof(i - 1) j = 0; j < i - 1; j++) {
      long long int temp = pow(2, i) - 1 - pow(2, j);
      if ((a <= temp) && (temp <= b)) {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
