#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, l, r, j, c = 0, i;
  long long int a, b, s[10000], k = 0, m;
  cin >> l >> r;
  for (i = 0; i < 31; i++) {
    a = pow(2, i);
    for (j = 0; j < 20; j++) {
      m = a * pow(3, j);
      if (m > 2000000000) {
        break;
      } else {
        s[k++] = m;
      }
    }
  }
  for (i = 0; i < k; i++) {
    if (s[i] >= l && s[i] <= r) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
