#include <bits/stdc++.h>
using namespace std;
long long int s[1005];
int main() {
  long long int l, r;
  cin >> l >> r;
  s[0] = 1;
  long long int nowmax = 1, a, b;
  int len = 1, ans = 0;
  while (nowmax <= 2000000000) {
    long long int nx = -1;
    for (int i = 0; i < len; i++) {
      a = s[i] * 2;
      b = s[i] * 3;
      if (a > nowmax && (nx == -1 || nx > a)) nx = a;
      if (b > nowmax && (nx == -1 || nx > b)) nx = b;
    }
    if (nx == -1) break;
    s[len++] = nowmax = nx;
  }
  for (int i = 0; i < len; i++)
    if (s[i] >= l && s[i] <= r) ans++;
  cout << ans;
  return 0;
}
