#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int l, r;
  cin >> l >> r;
  vector<long long int> v, ans;
  long long int x = 1;
  while (x <= r) {
    v.push_back(x);
    x *= 2;
  }
  x = 1;
  while (x <= r) {
    for (auto i : v) {
      long long int y = x * i;
      if (y > r) break;
      ans.push_back(y);
    }
    x *= 3;
  }
  sort(ans.begin(), ans.end());
  long long int n = 0;
  for (auto i : ans) {
    if (i >= l && i <= r) n++;
  }
  cout << n;
}
