#include <bits/stdc++.h>
using namespace std;
int main() {
  double p;
  double i = 0;
  vector<unsigned long long int> v1;
  while (p < (2000000000)) {
    p = (unsigned long long int)powl(2, i);
    v1.push_back(p);
    i++;
  }
  vector<unsigned long long int> v2;
  i = 0;
  p = 0;
  while (p < (3000000000)) {
    p = (unsigned long long int)powl(3, i);
    v2.push_back(p);
    i++;
  }
  set<unsigned long long int> s;
  unsigned long long int k;
  for (int i = 0; i < v1.size(); i++) {
    if (v1[i] < 2000000000) {
      for (int j = 0; j < v2.size(); j++) {
        if (v2[j] < 3000000000) {
          k = v1[i] * v2[j];
          if (k < 2000000000) {
            s.insert(k);
          } else {
            break;
          }
        }
      }
    }
  }
  long long int l, r;
  long long int c = 0;
  cin >> l >> r;
  for (auto m : s) {
    if (m >= l && m <= r) {
      c++;
    }
  }
  cout << c;
}
