#include <bits/stdc++.h>
using namespace std;
long ans = 0, a, b;
long long i, j, tmp1, tmp2;
int main() {
  cin >> a >> b;
  if (a <= 1 && b >= 1) ans++;
  for (i = 1, tmp1 = 1; i < 31; ++i) {
    tmp1 *= 2;
    if (a <= tmp1 && b >= tmp1) {
      ans++;
    }
    if (tmp1 > b) break;
    for (j = 1, tmp2 = tmp1; j < 25; ++j) {
      tmp2 *= 3;
      if (a <= tmp2 && b >= tmp2) {
        ans++;
      }
      if (tmp2 > b) break;
    }
  }
  for (i = 1, tmp1 = 1; i < 25; ++i) {
    tmp1 *= 3;
    if (a <= tmp1 && b >= tmp1) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
