#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> g;
long long mod = 1e9 + 7;
double eps = 1e-9;
double det(double a, double b, double c, double d) { return a * d - b * c; }
long long pow(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 1) {
    return (pow(a, b - 1) * a);
  }
  if (b % 2 == 0) {
    long long c = pow(a, b / 2);
    return (c * c);
  }
}
struct poll {
  double x, y;
  poll(double x, double y) {}
};
vector<vector<long long>> mat;
vector<vector<long long>> nul;
vector<vector<long long>> umn(vector<vector<long long>> a,
                              vector<vector<long long>> b, long long d) {
  vector<vector<long long>> ans = a;
  for (long long i = 0; i < a.size(); i++) {
    for (long long j = 0; j < a.size(); j++) {
      long long tmp = 0;
      for (long long z = 0; z < a.size(); z++) {
        tmp += a[i][z] * b[z][j];
      }
      ans[i][j] = tmp % d;
    }
  }
  return ans;
}
vector<vector<long long>> pow(vector<vector<long long>> a, long long c,
                              long long d) {
  if (c == 2) {
    return umn(a, a, d);
  }
  if (c % 2 == 1) {
    return umn(pow(a, c - 1, d), a, d);
  }
  if (c % 2 == 0) {
    vector<vector<long long>> b = pow(a, c / 2, d);
    return umn(b, b, d);
  }
}
struct pt {
  double x, y;
  pt(double x = 0, double y = 0) : x(x), y(y) {}
  pt operator+(pt b) {
    pt res;
    res.x = x + b.x;
    res.y = y + b.y;
    return res;
  }
  pt operator-(pt b) {
    pt res;
    res.x = x - b.x;
    res.y = y - b.y;
    return res;
  }
  pt operator*(double k) {
    pt res;
    res.x = x * k;
    res.y = y * k;
    return k;
  }
  pt operator==(pt b) {
    if (abs(x - b.x) < eps && abs(y - b.y) < eps)
      return true;
    else
      return false;
  }
  double dist2() { return x * x + y * y; }
  double sc(pt b) { return x * b.x + y * b.y; }
  double vect(pt b) { return x * b.y - b.x * y; }
  double polyar() {
    double k = atan2(y, x);
    if (k < 0) k = 4 * acos(0.0) + k;
    return k;
  }
  double ugol(pt b) { return acos(sc(b) / (sqrt(dist2()) * sqrt(b.dist2()))); }
};
struct line {
  double a, b, c;
  line(pt p1, pt p2) {
    a = p1.y - p2.y;
    b = p2.x - p1.x;
    c = p1.x * p2.y - p2.x * p1.y;
  }
  line() {}
  void linen(pt p, pt v) {
    a = v.x;
    b = v.y;
    c = -(a * p.x) - (b * p.y);
  }
  void linepar(line k, double r) {
    a = k.a;
    b = k.b;
    if (abs(a) > eps && abs(b) > eps) {
      pt n(a, b);
    } else
      c = k.c + r;
  }
  double distpt(pt p) {
    return abs((a * p.x + b * p.y + c) / sqrt(a * a + b * b));
  }
  bool prinad(pt p) {
    if (abs(a * p.x + b * p.y + c) < eps)
      return true;
    else
      return false;
  }
  pt peresech(line l2) {
    double zn = det(a, b, l2.a, l2.b);
    pt res;
    if (abs(zn) > eps) {
      res.x = -det(c, b, l2.c, l2.b) / zn;
      res.y = -det(a, c, l2.a, l2.c) / zn;
    }
    return res;
  }
  bool high(pt p) {
    if (p.y + eps > (-c - a * p.x) / b)
      return true;
    else
      return false;
  }
};
double squaretr(pt a, pt b, pt c) {
  pt f = a - c;
  pt s = b - c;
  return f.vect(s) / 2;
}
double squaremn(vector<pt> a) {
  double ans = 0;
  pt b = a[0], l = a[1];
  for (long long i = 2; i < a.size(); i++) {
    ans += squaretr(l, a[i], b);
    l = a[i];
  }
  return ans;
}
double distl(pt a, pt n, pt k) {
  pt f = k - n;
  pt s = a - n;
  double m = f.sc(s) / sqrt(f.dist2() * s.dist2());
  if (m < 0)
    m = max(-1.0, m);
  else
    m = min(1.0, m);
  double u = acos(m);
  line l(n, k);
  pt ans = n - a;
  if (u > acos(0.0))
    return sqrt(ans.dist2());
  else
    return l.distpt(a);
}
double distot(pt a, pt n, pt k) {
  pt f = k - n;
  pt s = a - n;
  double m = f.sc(s) / sqrt(f.dist2() * s.dist2());
  if (m < 0)
    m = max(-1.0, m);
  else
    m = min(1.0, m);
  double u = acos(m);
  line l(n, k);
  pt ans = n - a;
  if (u > acos(0.0))
    return sqrt(ans.dist2());
  else {
    swap(n, k);
    f = k - n;
    s = a - n;
    m = f.sc(s) / sqrt(f.dist2() * s.dist2());
    if (m < 0)
      m = max(-1.0, m);
    else
      m = min(1.0, m);
    u = acos(m);
    ans = n - a;
    if (u > acos(0.0))
      return sqrt(ans.dist2());
    else {
      return l.distpt(a);
    }
  }
}
double distbetot(pt b1, pt k1, pt b2, pt k2) {
  line l1(b1, k1);
  line l2(b2, k2);
  double zn = det(l1.a, l1.b, l2.a, l2.b);
  if (abs(zn) > eps) {
    pt res;
    res.x = -det(l1.c, l1.b, l2.c, l2.b) / zn;
    res.y = -det(l1.a, l1.c, l2.a, l2.c) / zn;
    if ((res.x >= b1.x) == (k1.x >= res.x) &&
        (res.y >= b1.y) == (k1.y >= res.y)) {
      if ((res.x >= b2.x) == (k2.x >= res.x) &&
          (res.y >= b2.y) == (k2.y >= res.y))
        return 0;
    }
  }
  double ans = distot(b1, b2, k2);
  ans = min(distot(k1, b2, k2), ans);
  ans = min(distot(b2, b1, k1), ans);
  ans = min(distot(k2, b1, k1), ans);
  return ans;
}
bool peresot(pt b1, pt k1, pt b2, pt k2) {
  line l1(b1, k1);
  line l2(b2, k2);
  double zn = det(l1.a, l1.b, l2.a, l2.b);
  if (abs(zn) > eps) {
    pt res;
    res.x = -det(l1.c, l1.b, l2.c, l2.b) / zn;
    res.y = -det(l1.a, l1.c, l2.a, l2.c) / zn;
    if ((res.x >= b1.x) == (k1.x >= res.x) &&
        (res.y >= b1.y) == (k1.y >= res.y)) {
      if ((res.x >= b2.x) == (k2.x >= res.x) &&
          (res.y >= b2.y) == (k2.y >= res.y))
        return true;
    }
  }
  if (abs(zn) < eps) {
    if ((b1.x >= b2.x) == (k2.x >= b1.x) && (b1.y >= b2.y) == (k2.y >= b1.y))
      return true;
    if ((b2.x >= b1.x) == (k1.x >= b2.x) && (b2.y >= b1.y) == (k1.y >= b2.y))
      return true;
  }
  if (b1.x == b2.x && b1.y == b2.y || b1.x == k2.x && b1.y == k2.y) return true;
  if (k1.x == b2.x && k1.y == b2.y || k1.x == k2.x && k1.y == k2.y) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int l, r;
  cin >> l >> r;
  vector<vector<long long>> matr;
  long long ans = 0;
  matr.resize(40, vector<long long>(40, -1));
  for (int i = 0; i < 40; i++) {
    for (int j = 0; j < 40; j++) {
      long long k = pow(2, i) * pow(3, j);
      if (k <= 2 * 1e9) {
        matr[i][j] = k;
        if (k >= l && k <= r) ans++;
      }
    }
  }
  cout << ans;
}
