#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 5;
const long long INF = (1ll << 31) - 1;
const double PI = 3.14159265359;
int l, r, a[1111111], cnt;
map<int, int> id;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> l >> r;
  int oldr = r;
  for (int i = 0; i <= 32; i++) {
    for (int j = 0; j <= 19; j++) {
      a[++cnt] = pow(2, i) * pow(3, j);
    }
  }
  sort(a + 1, a + cnt + 1);
  for (int i = 1; i <= cnt; i++) {
    id[a[i]] = i;
  }
  l = id[*lower_bound(a + 1, a + cnt + 1, l)];
  r = *lower_bound(a + 1, a + cnt + 1, r);
  if (r > oldr) {
    r = id[r] - 1;
  } else
    r = id[r];
  cout << r - l + 1;
}
