#include <bits/stdc++.h>
using namespace std;
const string FILENAME = "";
const bool FILE_IO = 1;
void init() {
  if (!FILENAME.empty()) {
    freopen((FILENAME + ".in").c_str(), "r", stdin);
    freopen((FILENAME + ".out").c_str(), "w", stdout);
  }
}
int main() {
  init();
  int l, r, ans = 0;
  cin >> l >> r;
  vector<long long> x, y;
  for (long long i = 1; i < 2 * 1000000000; i *= 2) {
    x.push_back(i);
  }
  for (long long i = 1; i < 2 * 1000000000; i *= 3) {
    y.push_back(i);
  }
  for (int i = 0; i < x.size(); i++) {
    for (int j = 0; j < y.size(); j++) {
      if (x[i] * y[j] <= r && x[i] * y[j] >= l) ans++;
    }
  }
  cout << ans;
  return 0;
}
