#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int l, r;
  cin >> l >> r;
  long long a = 1;
  int ans = 0;
  while (a <= r) {
    long long b = a;
    while (b <= r) {
      if (b >= l) ans++;
      b *= 3;
    }
    a *= 2;
  }
  cout << ans;
  return 0;
}
