#include <bits/stdc++.h>
using namespace std;
long long bgm(long long a, long long b, long long m) {
  a %= m;
  long long rem = 1;
  while (b) {
    if (b & 1) rem = (rem * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return rem;
}
long long inv(long long a, long long mod) { return bgm(a, mod - 2, mod); }
long long in() {
  long long a;
  assert(scanf("%lld", &a) != EOF);
  return a;
}
double dl() {
  double a;
  assert(scanf("%lf", &a) != EOF);
  return a;
}
const int MAX = 100005;
const long long MOD = 1000000007;
const long long NUM = 1e+18;
long long l, r;
vector<long long> one;
void make(long long now, bool st, bool zero) {
  if (now > NUM) return;
  if (zero) one.push_back(now);
  if (st and zero == false) make(now << 1, st, true);
  make(now << 1 | 1, true, zero);
}
int main() {
  make(0, 0, 0);
  sort((one).begin(), (one).end());
  l = in(), r = in();
  printf("%lld", (long long)(upper_bound((one).begin(), (one).end(), r) -
                             lower_bound((one).begin(), (one).end(), l))),
      puts("");
  return 0;
}
