#include <bits/stdc++.h>
using namespace std;
int l, r;
int ans;
map<int, int> vis;
priority_queue<long long, vector<long long>, greater<long long> > Q;
int main() {
  scanf("%d%d", &l, &r);
  Q.push(1);
  while (1) {
    long long f = Q.top();
    Q.pop();
    if (vis[f] == 1) continue;
    vis[f] = 1;
    if (f >= l && f <= r) ans++;
    if (f > r) break;
    Q.push(f * 2);
    Q.push(f * 3);
  }
  printf("%d\n", ans);
  return 0;
}
