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