#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long double pi = acos(-1);
long long sqr(long long a) { return a * a; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int l, r;
  cin >> l >> r;
  vector<long long> a;
  long long two = 1;
  while (two < 2e9) {
    long long tri = 1;
    while (tri < 2e9) {
      a.push_back(two * tri);
      tri *= 3;
    }
    two *= 2;
  }
  sort(a.begin(), a.end());
  cout << upper_bound(a.begin(), a.end(), r) -
              lower_bound(a.begin(), a.end(), l);
}
