#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long double pi = acos(-1);
const int ma = 2 * 1e9;
vector<long long> q;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie();
  long long x = 1, y = 1;
  while (x <= ma) {
    while (x * y <= ma) {
      q.push_back(x * y);
      y *= 3;
    }
    y = 1;
    x *= 2;
  }
  sort(q.begin(), q.end());
  long long a, s;
  cin >> a >> s;
  cout << upper_bound(q.begin(), q.end(), s) -
              upper_bound(q.begin(), q.end(), a - 1);
  return 0;
}
