#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int64_t lol;
using namespace std;
void Seeyouagain() {
  long long l, r;
  cin >> l >> r;
  long long out = 0, temp = 1;
  for (long long i = 0; i <= 19; ++i) {
    for (long long ii = 0; ii <= 32; ++ii) {
      temp = pow(2, ii);
      temp *= pow(3, i);
      if (temp >= l && temp <= r) ++out;
    }
  }
  cout << out;
}
signed main() {
  ios_base::sync_with_stdio(!cin.tie(nullptr));
  int64_t testc = 1;
  while (testc--) {
    Seeyouagain();
    cout << "\n";
  }
  return 0;
}
