#include <bits/stdc++.h>
using namespace std;
int solve(long long n) {
  int cnt = 0;
  for (long long i = 1; i <= n; i = i * 2) {
    for (long long j = i; j <= n; j *= 3) {
      cnt++;
    }
  }
  return cnt;
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << solve(r) - solve(l - 1);
}
