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