#include <bits/stdc++.h>
using namespace std;
void SMF() {
  long long l, r, z = 0;
  cin >> l >> r;
  for (long long x = 1; x <= r; x *= 2)
    for (long long y = 1; y <= r; y *= 3) z += (l <= x * y && x * y <= r);
  cout << z << "\n";
}
int main() {
  int CT = 1;
  while (CT--) SMF();
  return 0;
}
