#include <bits/stdc++.h>
using namespace std;
long long pre[120000];
int cnt;
inline void precalc() {
  for (int i = 2; i <= 60; i++) {
    long long tmp = (1LL << i) - 1;
    for (int j = 0; j < i - 1; j++) {
      cnt++;
      pre[cnt] = tmp - (1LL << j);
    }
  }
}
long long a, b;
int main() {
  int res = 0;
  precalc();
  scanf("%I64d %I64d", &a, &b);
  for (int i = 1; i <= cnt; i++) {
    if (a <= pre[i] && pre[i] <= b) res++;
  }
  printf("%d\n", res);
  return 0;
}
