#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, num = 0, x, y, p;
  cin >> l >> r;
  for (x = 0; x <= 50; x++) {
    for (y = 0; y <= 50; y++) {
      p = pow(2, x) * pow(3, y);
      if (p >= l && p <= r) {
        num++;
      }
    }
  }
  cout << num;
  return 0;
}
