#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("fast-math")
using namespace std;
const int INF = 1e9;
const long long INFll = 2e18;
const int BASE1 = 179;
const int BASE2 = 653;
const long long MOD = 1e9 + 7;
const int MAXN = 2e5;
const long double PI = 3.1415926535;
const long double EPS = 1e-10;
long long mypow(long long x, long long n) {
  if (n == 0) return 1;
  int d = mypow(x, n / 2);
  if (n % 2 == 1) return ((d) * (d)) * x;
  return ((d) * (d));
}
void solve() {
  long long l, r;
  cin >> l >> r;
  int res = 0;
  for (int i = 0; i < (32); i++) {
    for (int j = 0; j < (21); j++) {
      if (i + j <= 32) {
        int num = pow(2, i) * pow(3, j);
        res += (l <= num && num <= r);
      }
    }
  }
  cout << res << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
