#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = INF + 7;
const int MAXN = 100010;
long long f(long long x) {
  long long c = 0;
  for (int i = 0; i < 64; i++) {
    long long pw = (1LL << i);
    if (pw <= x) {
      for (int j = 0; j < i; j++) {
        if ((2LL * pw - 1LL) - (1LL << j) <= x) {
          c++;
        }
      }
    } else {
      break;
    }
  }
  return c;
}
int main() {
  long long a, b;
  while (cin >> a >> b) {
    cout << f(b) - f(a - 1) << endl;
  }
  return 0;
}
