#include <bits/stdc++.h>
using namespace std;
int main() {
  long l, r;
  cin >> l >> r;
  long long i = 1, t;
  int ck = 0, ck1, c = 0;
  while (i <= r) {
    if (ck)
      i *= 2;
    else
      ck++;
    t = i;
    ck1 = 0;
    while (t <= r) {
      if (ck1)
        t *= 3;
      else
        ck1++;
      if (t >= l && t <= r) c++;
    }
  }
  cout << c;
  return 0;
}
