#include <bits/stdc++.h>
int main(void) {
  long long int l, r;
  scanf("%I64d%I64d", &l, &r);
  long long int base = 1LL;
  int ans = 0;
  for (int x = 0; x <= 30; x++) {
    long long int cur = base;
    for (int y = 0; y <= 20; y++) {
      if (cur >= l && cur <= r) ans++;
      cur *= 3LL;
      if (cur > r) break;
    }
    base *= 2LL;
  }
  printf("%d", ans);
  return 0;
}
