#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, D = 63, inf = 1000000007, mod = inf;
long long a, b;
int z;
int main() {
  scanf("%lld %lld", &a, &b);
  for (int i = 1; i < D; i++) {
    long long x = (1ll << i) - 1;
    for (int j = 0; j < i - 1; j++) {
      long long t = x - (1ll << j);
      if (a <= t && t <= b) z++;
    }
  }
  printf("%d\n", z);
  return 0;
}
