#include <bits/stdc++.h>
using namespace std;
int main() {
  set<long long> s;
  for (long long a = 1; a <= 2 * 1e9; a *= 2) {
    for (long long b = 1; b <= 2 * 1e9; b *= 3) {
      s.insert(a * b);
    }
  }
  int l, r, ans = 0;
  cin >> l >> r;
  for (set<long long>::iterator it = s.begin(); it != s.end(); ++it)
    ans += *it <= r && *it >= l;
  cout << ans;
  return 0;
}
