#include <bits/stdc++.h>
using namespace std;
int solve(const long long b) {
  int ret = 0;
  for (int l = 2; l <= 62; l++) {
    long long t = (1ll << l) - 1;
    for (int i = 0; i < l - 1; i++) {
      if ((t ^ (1ll << i)) <= b) {
        ret++;
      }
    }
  }
  return ret;
}
int main() {
  long long a, b;
  scanf("%lld %lld", &a, &b);
  printf("%d", solve(b) - solve(a - 1));
  return 0;
}
