#include <bits/stdc++.h>
using namespace std;
int main() {
  const int INF = 2000000000;
  int v[326], c = 0;
  long long x, y;
  for (long long i = 1; i <= INF; i *= 3) {
    long long p2 = 1;
    long long ans = i * p2;
    while (ans <= INF) {
      v[c++] = ans;
      p2 = (p2 << 1);
      ans = i * p2;
    }
  }
  sort(v, v + c);
  scanf("%I64d%I64d", &x, &y);
  int i = 0, j;
  for (; v[i] < x && j < c; i++)
    ;
  for (j = i; v[j] <= y && j < c; j++)
    ;
  printf("%d\n", j - i);
  return 0;
}
