#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f, DOM = (1000 * 1000 * 1000 + 7);
const long double EPS = 1e-8;
const long long MX = 1000000ll * 1000000ll * 1000000ll;
map<long long, long long> m;
long long x, y;
vector<long long> a;
int32_t main() {
  cin >> x >> y;
  for (long long i = 1; i <= 2 * MX + 10; i *= 2)
    for (long long j = 1; j < (i / 2); j *= 2)
      if (!m[i - j - 1]) {
        m[i - j - 1] = 1;
        a.emplace_back(i - j - 1);
      }
  sort(a.begin(), a.end());
  long long ans = 0;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] < x) continue;
    if (a[i] > y) break;
    ans++;
  }
  cout << ans << "\n";
}
