#include <bits/stdc++.h>
using namespace std;
long long l, r;
long long solve(long long x) {
  long long ans = 0;
  while (x) {
    long long y = (x >> 1);
    for (long long i = 1; i <= 64; i++) {
      if (y >= (1ull << i) - 1)
        ans++;
      else
        break;
    }
    if ((x & 1) == 0) x--;
    x >>= 1;
  }
  return ans;
}
int main() {
  scanf("%I64d%I64d", &l, &r);
  cout << solve(r) - solve(l - 1);
}
