#include <bits/stdc++.h>
int r, l;
void Count(std::set<long long> &s, long long a) {
  if (a > r) return;
  if (a >= l) s.insert(a);
  Count(s, a * 2);
  Count(s, a * 3);
}
int main(int argc, char const *argv[]) {
  std::set<long long> s;
  std::cin >> l >> r;
  Count(s, 1ll);
  std::cout << s.size() << std::endl;
  return 0;
}
