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