#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int l, r;
  cin >> l >> r;
  long long int a = 1;
  long long int answer = 0;
  while (a <= r) {
    if (a <= r && a >= l) answer++;
    a *= 2;
  }
  while (a >= 2) {
    a /= 2;
    long long int b = a * 3;
    while (b <= r) {
      if (b >= l) answer++;
      b *= 3;
    }
  }
  cout << answer;
  return 0;
}
