#include <bits/stdc++.h>
using namespace std;
long long pow(long long a, long long n) {
  long long res = 1;
  for (long long i = 0; i < n; i++) {
    res *= a;
  }
  return res;
}
int32_t main() {
  long long l, r;
  cin >> l >> r;
  long long x, y, tmp;
  x = y = 0;
  tmp = r;
  while (tmp > 1) {
    tmp /= 2;
    x++;
  }
  tmp = r;
  while (tmp > 1) {
    tmp /= 3;
    y++;
  }
  long long cnt = 0;
  for (long long i = 0; i <= x; i++) {
    for (long long j = 0; j <= y; j++) {
      long long res = pow(2, i) * pow(3, j);
      if (l <= res && res <= r) {
        cnt++;
      }
    }
  }
  cout << cnt << '\n';
}
