#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, r, ans = 0;
  long long s, t;
  scanf("%d%d", &n, &r);
  t = 1;
  while (t <= r) {
    s = t;
    while (s < n) {
      s = s * 3;
    }
    while (s <= r) {
      ans++;
      s = s * 3;
    }
    t = t * 2;
  }
  printf("%d", ans);
}
