#include <bits/stdc++.h>
using namespace std;
long long lo, hi;
int main(void) {
  scanf("%lld%lld", &lo, &hi);
  int sol = 0;
  for (int i = 0; i < 63; ++i) {
    for (int j = 0; j < i; ++j) {
      long long n = (1LL << (i + 1)) - (1LL << j) - 1;
      sol += lo <= n && hi >= n;
    }
  }
  printf("%d\n", sol);
  return 0;
}
