#include <bits/stdc++.h>
unsigned long long power(unsigned long long x, unsigned long long p) {
  if (x == 0) {
    return 0;
  }
  if (p == 0) {
    return 1;
  }
  if (p % 2 == 0) {
    return power(x * x, p >> 1);
  }
  return x * power(x * x, p >> 1);
}
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  unsigned long long l = a, r = b;
  unsigned long long ans = 0;
  for (int x = 0; x < 40; ++x) {
    for (int y = 0; y < 30; ++y) {
      unsigned long long t = 1LL << x;
      t *= power(3, y);
      if (l <= t && t <= r) {
        ++ans;
      }
    }
  }
  printf("%I64d\n", ans);
}
