#include <bits/stdc++.h>
using namespace std;
int f(long long x) {
  long long i, j, cnt = 0;
  for (i = 1; i <= x; i *= 2) {
    for (j = i; j <= x; j *= 3) cnt++;
  }
  return cnt;
}
int main() {
  int l, r;
  cin >> l >> r;
  cout << f(r) - f(l - 1);
}
