#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long l, r;
  cin >> l >> r;
  long long ans = 0;
  for (long long i = 1; i <= r; i *= 2) {
    long long cur = i;
    while (cur <= r) {
      if (cur >= l) ans++;
      cur *= 3;
    }
  }
  cout << ans;
  return 0;
}
