#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  long long temp;
  cin >> a >> b;
  int alen = 1;
  int blen = 1;
  temp = a;
  while ((temp >> alen) > 0) alen++;
  temp = b;
  while ((temp >> blen) > 0) blen++;
  int ans = 0;
  long long templen = alen;
  while (templen <= blen) {
    long long binary = 0;
    binary = ~binary;
    binary = binary << templen;
    binary = ~binary;
    binary = binary;
    for (long long i = 0; i < templen - 1; i++) {
      long long ceshi = 1;
      ceshi = ceshi << i;
      if ((binary - ceshi) >= a and b >= (binary - ceshi)) {
        ans++;
      }
    }
    templen++;
  }
  cout << ans << endl;
}
