#include <bits/stdc++.h>
using namespace std;
int read() {
  int xx = 0, ff = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    xx = xx * 10 + ch - '0';
    ch = getchar();
  }
  return xx * ff;
}
int l, r, ans = 0;
map<int, int> G;
void dfs(long long x) {
  if (G[x]) return;
  if (x > r) return;
  if (x >= l && x <= r) {
    ans++;
    G[x]++;
  }
  dfs(x * 3);
  dfs(x * 2);
}
int main() {
  l = read();
  r = read();
  dfs(1);
  cout << ans << endl;
  return 0;
}
