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