#include <bits/stdc++.h>
int main() {
  long long int t, m, n, i, a, c = 0, b, d = 0, j, mt, k;
  scanf("%lld%lld", &a, &b);
  for (i = 1; i <= b; i *= 2) {
    for (j = 1; j <= b; j *= 3) {
      if (i * j >= a && i * j <= b) c++;
    }
  }
  printf("%lld\n", c);
}
