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