#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
set<long long> ans;
int main() {
  long long l, r;
  cin >> l >> r;
  set<long long> s, m;
  long long k = 1;
  while (k <= r) {
    s.insert(k);
    k *= 2;
  }
  k = 1;
  while (k <= r) {
    m.insert(k);
    k *= 3;
  }
  for (auto c : m) {
    for (auto x : m) {
      long long z = c * x;
      if (z >= l and z <= r) ans.insert(z);
    }
  }
  for (auto x : s) {
    for (auto c : s) {
      long long z = x * c;
      if (z >= l and z <= r) ans.insert(z);
    }
  }
  for (auto x : s) {
    for (auto c : m) {
      long long z = c * x;
      if (z >= l and z <= r) ans.insert(z);
    }
  }
  long long res = ans.size();
  cout << res << endl;
}
