#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long l, r;
  long long i, j;
  int o;
  scanf("%I64d %I64d", &l, &r);
  for (i = 1, o = 0; i <= r; i <<= 1)
    for (j = 1; i * j <= r; j *= 3) o += l <= i * j;
  printf("%d\n", o);
  return 0;
}
