#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  long long a, b;
  cin >> a >> b;
  long long aa = a, bb = b;
  int pos = -1;
  int k = 0, kk = 0, c = 0;
  while (a) {
    k++;
    a >>= 1LL;
  }
  while (b) {
    kk++;
    b >>= 1LL;
  }
  int cnt = 0;
  for (int i = k; i <= kk; i++) {
    for (int j = 0; j < i - 1; j++) {
      long long tmp = (1LL << (i)) - 1 - (1LL << j);
      if (tmp >= aa && tmp <= bb) cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
