#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> num2, num3;
  long long ans = 2;
  while (ans <= 2000000005) {
    num2.push_back(ans);
    ans *= 2;
  }
  ans = 3;
  while (ans <= 2000000005) {
    num3.push_back(ans);
    ans *= 3;
  }
  vector<long long> ans1;
  ans1.push_back(1);
  for (int i = 0; i < num2.size(); i++) ans1.push_back(num2[i]);
  for (int i = 0; i < num3.size(); i++) ans1.push_back(num3[i]);
  for (int i = 0; i < num2.size(); i++)
    for (int j = 0; j < num3.size(); j++) ans1.push_back(num2[i] * num3[j]);
  long long l, r, cnt = 0;
  cin >> l >> r;
  sort(ans1.begin(), ans1.end());
  for (int i = 0; i < ans1.size(); i++)
    if (ans1[i] >= l && ans1[i] <= r) cnt++;
  cout << cnt << "\n";
}
