#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int64_t> p2 = {1}, p3 = {1};
  while (p2.back() * 2 < INT_MAX) p2.push_back(p2.back() * 2);
  while (p3.back() * 3 < INT_MAX) p3.push_back(p3.back() * 3);
  set<int64_t> s;
  for (int64_t it : p2)
    for (int64_t jt : p3) s.insert(it * jt);
  vector<int64_t> v(s.begin(), s.end());
  int l, r;
  cin >> l >> r;
  cout << upper_bound(v.begin(), v.end(), r) -
              lower_bound(v.begin(), v.end(), l);
  return 0;
}
