#include <bits/stdc++.h>
long long int Max(long long int a, long long int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long int Min(long long int a, long long int b) {
  if (a > b) {
    return b;
  } else {
    return a;
  }
}
int main() {
  long long int a, b;
  while (scanf("%lld %lld", &a, &b) == 2) {
    long long int res = 0, temp, i, j, counter = 0, temp1, Mx, Mn, sqrtl;
    Mx = Max(a, b);
    Mn = Min(a, b);
    long long int r = 0;
    for (i = 0;; i += 1) {
      temp = powl(2, i);
      for (j = 0;; j += 1) {
        temp1 = powl(3, j);
        res = temp * temp1;
        if (res > Mx) break;
        if (res <= Mx && res >= Mn) {
          counter += 1;
        }
      }
      if (temp >= Mx) break;
    }
    printf("%lld\n", counter);
  }
  return 0;
}
