#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long l, r;
  cin >> l >> r;
  long long cnt = 0;
  for (unsigned long long i = 1; i <= 2000000000; i *= 2) {
    for (unsigned long long j = 1; (i * j) <= 2000000000; j *= 3) {
      if ((i * j) >= l && (i * j) <= r) {
        cnt++;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
