#include <bits/stdc++.h>
int main() {
  int P[1000] = {0}, a, b, k = 0;
  for (int i = 0; i < 31; i++) {
    for (int j = 0; j < 31; j++) {
      P[k] = pow(2, i) * pow(3, j);
      k++;
    }
  }
  while (scanf("%d %d", &a, &b) != EOF) {
    int cnt = 0;
    for (int i = 0; i < 1000; i++) {
      if (P[i] >= a && P[i] <= b) cnt++;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
