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