#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
long long l, r, a, cnt, ans, sum, x, y;
map<long long, long long> mp;
void DNM() {
  cin >> l >> r;
  y = x = 1;
  ans = 0;
  for (long long i = 0; i < N - 1; i++) {
    for (long long j = 0; j < N - 1; j++) {
      cnt = y * x;
      if (cnt > r) break;
      if (cnt >= l and mp[cnt] == 0) mp[cnt]++, ans++;
      y *= 3;
    }
    if (x > r) break;
    x *= 2;
    y = 1;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int Qu_l_uQ = 1;
  while (Qu_l_uQ--) DNM();
}
