#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, i, b, ta, tb, da, db, sum = 0, alimit, blimit, pow2, temp;
  cin >> a >> b;
  ta = a;
  tb = b;
  for (da = 0; ta > 0; ta >>= 1) da++;
  for (db = 0; tb > 0; tb >>= 1) db++;
  for (i = da; i < db; i++) {
    sum += i;
  }
  alimit = 1, blimit = 1;
  for (i = 0; i < da; i++) alimit *= 2;
  for (i = 0; i < db; i++) blimit *= 2;
  if (a == 1) alimit = 1;
  pow2 = 1;
  --alimit;
  temp = alimit - 1;
  i = 1;
  while (a <= temp && i < da) {
    sum++;
    pow2 *= 2;
    temp = alimit - pow2;
    i++;
  }
  if (b == 1) blimit = 1;
  pow2 = 1;
  --blimit;
  temp = blimit - 1;
  i = 1;
  while (b < temp && i < db) {
    sum--;
    pow2 *= 2;
    temp = blimit - pow2;
    i++;
  }
  cout << sum;
  return 0;
}
