#include <bits/stdc++.h>
using namespace std;
long long m = 2000000000;
int main() {
  long long l, r, x = 0;
  long long z = 1, p = 1;
  cin >> l >> r;
  int c = 0;
  for (int i = 0; i < 31; i++) {
    p = 1;
    for (int j = 0; j < 31; j++) {
      x = z * p;
      if (x <= r && x >= l) c++;
      p = p * 2;
    }
    z = z * 3;
  }
  cout << c << endl;
}
