#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b;
  cin >> a >> b;
  long long int y;
  long long int ar[100005];
  long long int cnt = 0;
  for (int i = 1; i <= 62; i++) {
    y = (long long int)1 << i;
    for (int j = 0; j < i - 1; j++) {
      long long int q = (long long int)1 << j;
      ar[cnt++] = y - 1 - q;
    }
  }
  int g = 0;
  for (int i = 0; i < cnt; i++) {
    if (ar[i] >= a && ar[i] <= b) g++;
  }
  cout << g << endl;
  return 0;
}
