#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int a, b;
  cin >> a >> b;
  long long int cnt = 0;
  for (long long int i = 0; i < 64; ++i) {
    for (long long int j = 0; j < i - 1; ++j) {
      long long int temp = (1ll << i) - 1 - (1ll << j);
      cnt += temp >= a and temp <= b;
    }
  }
  cout << cnt << endl;
}
