#include <bits/stdc++.h>
using namespace std;
int a[100007];
long long exp(long long a, long long b, long long mod = 1e9 + 7) {
  long long tem = 1;
  while (b) {
    if (b % 2) tem = (tem * a) % mod;
    a = (a * a) % mod;
    b = b / 2;
  }
  return tem;
}
int main() {
  int m, p;
  cin >> m >> p;
  int ans = 0;
  long long i = 1, j = 1;
  while (i <= p) {
    j = 1;
    while (i * j <= p) {
      ans += (i * j >= m);
      j *= 3;
    }
    i *= 2;
  }
  cout << ans;
  return 0;
}
