#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000001;
const long long int LLINF = 1000000000000000001LL;
int main() {
  ios_base::sync_with_stdio(0);
  long long int a, b;
  cin >> a >> b;
  long long int ans = 0;
  for (int len = (2); len <= (60); ++len)
    for (int zero = (0); zero <= (len - 2); ++zero) {
      long long int num = (1LL << len) - 1;
      num -= (1LL << zero);
      if (num >= a && num <= b) {
        ans++;
      }
    }
  cout << ans;
  return 0;
}
