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