#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long l, r, c = 0;
  cin >> l >> r;
  for (unsigned long long i = 1; i <= r; i = i * 2) {
    for (unsigned long long j = 1; j <= r; j = j * 3) {
      if (i * j >= l && i * j <= r) c = c + 1;
    }
  }
  cout << c;
  return 0;
}
