#include <bits/stdc++.h>
using namespace std;
vector<long long int> a;
long long int nn = 1e9;
int main() {
  long long int l, r;
  scanf("%lld %lld", &l, &r);
  for (long long int i = 0; i <= 30; ++i) {
    for (long long int j = 0; j <= 20; ++j) {
      long long int x = pow(2, i);
      long long int y = pow(3, j);
      if ((x > nn && y > nn) || x * y > 2 * nn) {
        continue;
      }
      a.push_back(x * y);
    }
  }
  sort(a.begin(), a.end());
  int ans = 0;
  for (int i = 0; i < (int)a.size(); ++i) {
    if (a[i] > r) break;
    if (a[i] >= l && a[i] <= r) ans++;
  }
  printf("%d\n", ans);
}
