#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long SIZE = 100000;
const int INF = 0x3f3f3f3f;
const long long ll_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acos(-1);
const long long MAXN = numeric_limits<long long>::max();
const long long MAX = 2000000;
void disp(vector<long long> v) {
  for (auto u : v) cout << u << " ";
  cout << '\n';
}
void solve() {
  long long l, r, x = 0, y = 1, temp, ans = 0;
  cin >> l >> r;
  y = 1;
  while (y <= r) {
    temp = y;
    if (temp >= l && temp <= r) ans++;
    while (temp <= r) {
      temp *= 2;
      if (temp >= l && temp <= r) ans++;
    }
    y *= 3;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
