#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int l, r;
  cin >> l >> r;
  int i, cnt = 0, j;
  vector<long long int> v1, v2;
  set<long long int> s;
  for (i = 0; i <= 35; ++i) {
    v1.push_back(pow(2, i));
  }
  for (i = 0; i <= 35; ++i) {
    v2.push_back(pow(3, i));
  }
  for (i = 0; i < v1.size(); ++i) {
    for (j = 0; j < v2.size(); ++j) {
      s.insert(v1[i] * v2[j]);
    }
  }
  for (auto it = s.begin(); it != s.end(); ++it) {
    if (*it >= l && *it <= r) cnt++;
  }
  cout << cnt;
  return 0;
}
