#include <bits/stdc++.h>
using namespace std;
int ROW[] = {+1, -1, +0, +0};
int COL[] = {+0, +0, +1, -1};
int X[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int Y[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int KX[] = {-2, -2, -1, -1, 1, 1, 2, 2};
int KY[] = {-1, 1, -2, 2, -2, 2, -1, 1};
int basePrime[] = {1009, 1013, 1019, 1021, 1031, 1223, 1229, 1231, 1237, 1249,
                   1289, 1291, 1297, 1301, 1303, 353,  359,  367,  373,  379,
                   859,  863,  877,  881,  883,  1931, 1933, 1949, 1951, 1973,
                   401,  409,  419,  421,  431,  1709, 1721, 1723, 1733, 1741,
                   3499, 3511, 3517, 3527, 3529, 929,  937,  941,  947,  953};
template <class XXX>
XXX GCD(XXX a, XXX b) {
  return b == 0 ? a : GCD(b, a % b);
}
template <class XXX>
XXX LCM(XXX a, XXX b) {
  return a * (b / GCD(a, b));
}
template <class XXX, class YYY>
bool CMP(XXX a, YYY b) {
  return a > b;
}
template <class XXX>
void fastread(XXX &number) {
  bool negative = false;
  register XXX c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  long long int l, r, cnt = 0;
  cin >> l >> r;
  map<long long int, int> mp;
  vector<long long int> ans = {2, 3};
  for (int i = 0; i < ans.size(); i++) {
    if (2 * ans[i] <= 2000000008 and !mp[ans[i] * 2]) {
      ans.push_back(2 * ans[i]);
      if (ans[i] * 2 >= l and ans[i] * 2 <= r) cnt++;
    }
    mp[ans[i] * 2] = 1;
  }
  for (int i = 0; i < ans.size(); i++) {
    if (3 * ans[i] <= 2000000008 and !mp[ans[i] * 3]) {
      ans.push_back(3 * ans[i]);
      if (ans[i] * 3 >= l and ans[i] * 3 <= r) cnt++;
    }
    mp[ans[i] * 3] = 1;
  }
  cout << (l == 1) + cnt + (l <= 2 and r >= 2) + (l <= 3 and r >= 3) << endl;
  return 0;
}
