#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, ans = 0;
  long long arr[60], arr2[38];
  bool b[60][60] = {};
  cin >> l >> r;
  arr[0] = 1, arr2[0] = 1;
  for (int i = 1; i < 60; i++) arr[i] = (2 * arr[i - 1]);
  for (int i = 1; i < 38; i++) arr2[i] = (3 * arr2[i - 1]);
  for (int i = 0; i < 60; i++) {
    for (int j = 0; j < 38; j++) {
      if (arr[i] * arr2[j] >= l && arr[i] * arr2[j] <= r) ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
