#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
const long long MOD = 1e9 + 7;
long long n_bits(long long n) {
  long long x = __builtin_popcount(n);
  return x;
}
int pow(int a, int b, int m) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    vector<long long> ans;
    ans.push_back(1);
    for (long long i = 2; i <= 2000000000; i *= 2) {
      for (long long j = 3; j <= 2000000000; j *= 3) {
        ans.push_back(i);
        ans.push_back(j);
        ans.push_back(i * j);
      }
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    auto pos1 = lower_bound(ans.begin(), ans.end(), a) - ans.begin();
    auto pos2 = lower_bound(ans.begin(), ans.end(), b) - ans.begin();
    if (ans[pos2] == b) {
      pos2++;
    }
    cout << pos2 - pos1 << endl;
  }
  return 0;
}
