#include <bits/stdc++.h>
using namespace std;
long long st2[60], st3[25];
int main() {
  long long st = 1;
  for (int i = 0; i < 60; i++) {
    st2[i] = st;
    st *= 2;
  }
  st = 1;
  for (int i = 0; i < 25; i++) {
    st3[i] = st;
    st *= 3;
  }
  long long temp;
  long long l, r;
  cin >> l >> r;
  long long ans = 0;
  for (int i = 0; i < 60; i++) {
    for (int j = 0; j < 25; j++) {
      temp = st2[i] * st3[j];
      if (temp >= l && temp <= r) {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
