#include <bits/stdc++.h>
using namespace std;
int num[1001];
int main() {
  int l, r, ed, cnt;
  scanf("%d%d", &l, &r);
  ed = 0;
  for (long long i = 1; i <= 2000000000; i *= 2)
    for (long long j = 1; i * j <= 2000000000; j *= 3) num[ed++] = i * j;
  sort(num, num + ed);
  cnt = 0;
  for (int i = 0; i < ed; i++)
    if (num[i] >= l && num[i] <= r) cnt++;
  printf("%d\n", cnt);
  return 0;
}
