#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
double EPS = 1e-7;
int INF = 1000000000;
long long INFLL = 1000000000000000000LL;
int mx[8] = {-1, 1, 0, 0, -1, -1, 1, 1};
int my[8] = {0, 0, -1, 1, -1, 1, -1, 1};
int main() {
  long long xx, yy;
  cin >> xx >> yy;
  int cnt = 0;
  for (int(a) = (2); (a) <= (63); (a)++) {
    long long x = (1LL << a) - 1;
    for (int(b) = (0); (b) <= (a - 2); (b)++) {
      long long y = x - (1LL << b);
      if (xx <= y && y <= yy) {
        cnt++;
      }
    }
  }
  cout << cnt << endl;
}
