#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int l, r;
  cin >> l >> r;
  long long int res = 0;
  for (long long int i = 1; i <= r; i *= 2) {
    for (long long int j = 1; j <= r; j *= 3) {
      if (i * j <= r && i * j >= l) {
        res++;
      }
    }
  }
  cout << res;
  return 0;
}
