#include <bits/stdc++.h>
using namespace std;
inline unsigned long long read() {
  char ch = getchar();
  unsigned long long f = 1, x = 0;
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
unsigned long long l, r;
inline unsigned long long Query(unsigned long long x) {
  unsigned long long now = 0, res = 0;
  for (register unsigned long long i = 0; i <= x; ++i) now |= (1ull << i);
  for (register unsigned long long i = 0; i < x; ++i) {
    now -= (1ull << i);
    if (l <= now && now <= r) res++;
    now += (1ull << i);
  }
  return res;
}
inline unsigned long long Count() {
  unsigned long long res = 0;
  for (register unsigned long long i = 0; i <= 63; ++i) res += Query(i);
  return res;
}
signed main() {
  l = read(), r = read();
  printf("%llu\n", Count());
  return 0;
}
