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