#include <bits/stdc++.h>
long long minn = INT_MAX;
long long maxx = INT_MAX;
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long l, r;
  cin >> l >> r;
  long long count = 0;
  long long p2 = 0, py = 0, cal_num;
  for (long long i = 0; i < 31; i++) {
    for (long long j = 0; j < 31; j++) {
      cal_num = pow(2, i) * pow(3, j);
      if (cal_num >= l && cal_num <= r) count++;
      if (cal_num > r) break;
    }
  }
  cout << count << "\n";
  return 0;
}
