#include <bits/stdc++.h>
using namespace std;
set<long long> s;
vector<long long> v;
void settable() {
  s.insert(1);
  set<long long>::iterator iter = s.begin();
  int count = 1;
  long long temp = *iter;
  while (temp <= 2e9) {
    long long t = *iter;
    s.insert(t * 2);
    s.insert(t * 3);
    temp = t * 3;
    iter++;
  }
  iter = s.begin();
  while (iter != s.end()) {
    v.push_back(*iter++);
  }
}
int main() {
  settable();
  int l, r;
  scanf("%d%d", &l, &r);
  int num =
      upper_bound(v.begin(), v.end(), r) - lower_bound(v.begin(), v.end(), l);
  printf("%d\n", num);
  return 0;
}
