#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> two;
  for (long long k = 1; k <= 2000000000; k *= 2) two.push_back(k);
  vector<long long> three;
  for (long long k = 1; k <= 2000000000; k *= 3) three.push_back(k);
  vector<long long> twothree;
  for (long long k = 0; k < two.size(); k++)
    for (long long l = 0; l < three.size(); l++)
      twothree.push_back(two[k] * three[l]);
  long long l, r;
  cin >> l >> r;
  int ans = 0;
  for (int k = 0; k < twothree.size(); k++)
    if (twothree[k] >= l && twothree[k] <= r) ans++;
  cout << ans << endl;
}
