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