#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, r, lb, ub;
  long long temp = 1, temp1;
  cin >> l >> r;
  vector<long long> li;
  for (int i = 1; i < 32; i++) {
    li.push_back(temp);
    temp1 = temp;
    do {
      temp1 *= 3;
      li.push_back(temp1);
    } while (temp1 <= r);
    temp *= 2;
  }
  sort(li.begin(), li.end());
  lb = 0;
  ub = li.size() - 1;
  while (lb <= ub && li[lb] < l) lb++;
  while (ub >= 0 && li[ub] > r) ub--;
  cout << ub - lb + 1;
  return 0;
}
