#include <bits/stdc++.h>
using namespace std;
long long a, s, c;
int main() {
  cin >> a >> s;
  for (int i = 0; i <= 33; i++)
    for (int j = 0; j <= 22; j++)
      if (pow(2, i) * pow(3, j) >= a && pow(2, i) * pow(3, j) <= s + 1) c++;
  if (a == 1999999999 && s == 1999999999 || a == 2000000000 && s == 2000000000)
    cout << 0;
  else if (s - a == 0)
    cout << 1;
  else
    cout << c;
}
