#include <bits/stdc++.h>
using namespace std;
const double EPS = -1e8;
const double Pi = acos(-1);
bool inline equ(double a, double b) { return fabs(a - b) < EPS; }
void _R(int& x) { scanf("%d", &x); }
void _R(long long& x) { scanf("%" PRId64, &x); }
void _R(double& x) { scanf("%lf", &x); }
void _R(char* s) { scanf("%s", s); }
void R() {}
template <typename T1, typename... T2>
void R(T1& x, T2&... tail) {
  _R(x);
  R(tail...);
}
template <typename Iter, typename F>
inline void out(Iter s, Iter e, F of) {
  bool flag = 0;
  for (Iter it = s; it != e; it++) {
    if (flag)
      printf(" ");
    else
      flag = 1;
    of(*it);
  }
  puts("");
}
vector<long long> ans;
int main() {
  for (int i = (2); i <= (63); i++) {
    long long x = (1ll << i) - 1ll;
    for (int j = 0; j < (i - 1); j++) ans.push_back(x - (1ll << j));
  }
  sort((ans).begin(), (ans).end());
  long long a, b;
  cin >> a >> b;
  int l = lower_bound((ans).begin(), (ans).end(), a) - ans.begin();
  int r = upper_bound((ans).begin(), (ans).end(), b) - ans.begin();
  cout << r - l << endl;
}
