#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x = 1, a, b, k = 1, l = 2, dem = 0, o = 0;
  cin >> a >> b;
  while (true) {
    if (k >= a && k != 1) {
      dem++;
    }
    if (k + x > b) {
      break;
      return 0;
    }
    k += x;
    x /= 2;
    if (x == 0) {
      l = (l - 1) * 2 + 1;
      x = l;
    }
  }
  cout << dem;
  return 0;
}
