#include <bits/stdc++.h>
using namespace std;
int l, r;
int ret;
bool visited[10000][10000];
void dfs(long long cur, int two, int three) {
  if (cur > r) return;
  if (visited[two][three]) return;
  visited[two][three] = true;
  if (cur >= l) ret += 1;
  dfs(cur * 2, two + 1, three);
  dfs(cur * 3, two, three + 1);
}
int main(void) {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> l >> r;
  dfs(1, 0, 0);
  cout << ret << '\n';
  return 0;
}
