#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> arr;
  int ctr = 0;
  for (long long int i = 0; i < 40; i++) {
    for (long long int j = 0; j <= 30; j++) {
      arr.push_back(pow(2, j) * pow(3, i));
      ctr++;
    }
  }
  long long int mini = 0, maxi = 0;
  cin >> mini >> maxi;
  long long int cou = 0;
  long long int i = 0;
  while (i <= ctr) {
    if (arr[i] >= mini && arr[i] <= maxi) {
      cou++;
    }
    i++;
  }
  cout << cou;
  return 0;
}
