#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int main(int argc, char** argv) {
  long long a, b;
  cin >> a >> b;
  int ln1 = 0, ln2 = 0;
  long long ta = a, tb = b;
  while (ta) {
    ta /= 2;
    ln1++;
  }
  while (tb) {
    tb /= 2;
    ln2++;
  }
  set<long long> st;
  for (long long ln = 2; ln <= ln2; ln++) {
    long long mask = 1ll << ln;
    mask--;
    for (long long i = 0; i < (ln - 1); i++) {
      long long cur = mask & (~(1ll << i));
      if (cur >= a && cur <= b) st.insert(cur);
    }
  }
  cout << st.size();
  return 0;
}
