#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, x, sum = 1;
  cin >> l >> r;
  int flag = 0;
  int m = 0;
  for (; sum <= r;) {
    for (; sum <= r;) {
      if (m == 0) {
        x = sum;
        m++;
      }
      if (sum >= l) flag++;
      sum *= 3;
    }
    m = 0;
    sum = x;
    sum *= 2;
  }
  cout << flag;
  return 0;
}
