#include <bits/stdc++.h>
using namespace std;
const int MAX_BIT = 62;
int main() {
  long long a, b;
  scanf("%lli %lli", &a, &b);
  int awns = 0;
  for (int i = 0; i < MAX_BIT; i++) {
    for (int j = 0; j + 1 < i; j++) {
      long long baseNum = (1LL << i) - 1;
      long long zero = (1LL << j);
      long long num = baseNum - zero;
      if ((num >= a) && (num <= b)) {
        awns++;
      }
    }
  }
  printf("%i\n", awns);
}
