#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1000000007;
int64_t maxm(int64_t a, int64_t b) { return a > b ? a : b; }
int64_t minm(int64_t a, int64_t b) { return a > b ? b : a; }
const int64_t inf = 1e18;
int64_t powr(int64_t x, int64_t n) {
  int64_t result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = result * x;
    x = x * x;
    n = n / 2;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  int64_t l, r, i, j, c = 0;
  cin >> l >> r;
  for (i = 0; i <= 32; i++) {
    for (j = 0; j <= 20; j++) {
      int64_t x = powr(2, i) * powr(3, j);
      if (x >= l && x <= r) c++;
    }
  }
  cout << c;
}
