#include <bits/stdc++.h>
using namespace std;
const string LN = "\n";
const double eps = 1e-7;
const double pi = acos(-1.0);
const int INF = (int)2e9 + 7;
const unsigned long long LINF = (unsigned long long)9e18 + 7;
bool insert(int k, int x1, int x2) { return (k >= x1 && k <= x2); }
unsigned long long k1, k2;
unsigned long long ans = 0;
unsigned long long op(int a) {
  unsigned long long pro = 1;
  for (int i = 0; i < a; i++) pro *= (unsigned long long)2;
  return pro;
}
unsigned long long con(vector<int> a) {
  unsigned long long sum = 0;
  for (int i = 0; i < a.size(); i++) sum += op(a.size() - 1 - i) * a[i];
  return sum;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> k1 >> k2;
  for (int i = 1; i <= 60; i++) {
    vector<int> a;
    a.push_back(1);
    for (int sdgsdfgfdsg = 0; sdgsdfgfdsg < i; sdgsdfgfdsg++) a.push_back(1);
    for (int j = 1; j <= a.size() - 1; j++) {
      a[j] = 0;
      unsigned long long q = con(a);
      if (q >= k1 && q <= k2) ans++;
      a[j] = 1;
    }
  }
  cout << ans;
}
