#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, t, ans = 0;
  cin >> a >> b;
  for (int i = 2; i <= 60; i++)
    for (int j = 0; j < i - 1; j++) {
      t = (1LL << i) - 1 - (1LL << j);
      if (a <= t && t <= b) ans++;
    }
  cout << ans << endl;
}
