#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

typedef unsigned long long ll;

set<ll> st;

void mul(ll &x, int k) {
    ll nx = x * k;
    if (nx / k != x) nx = 2e18;
    x = nx;
}

void rec(ll x, ll cur, int k) {
    if (k == 3) {
        for (int i = 1;; i++) {
            ll o = cur;
            for (int j = 0; j < 6; j++) mul(o, i);
            if (o <= x) st.insert(o);
            else break;
        }
        return;
    }
    ll p = 1;
    if (k == 0) {
        for (int i = 0; i < 5; i++) mul(cur, 2);
        for (int i = 0; i < 6; i++) mul(p, 2);
    }
    if (k == 1) {
        for (int i = 0; i < 2; i++) mul(cur, 3);
        for (int i = 0; i < 6; i++) mul(p, 3);
    }
    if (k == 2) {
        for (int i = 0; i < 3; i++) mul(cur, 5);
        for (int i = 0; i < 6; i++) mul(p, 5);
    }
    while (cur <= x) {
        rec(x, cur, k + 1);
        mul(cur, p);
    }
}

int solve(ll x) {
    st.clear();
    rec(x, 1, 0);
    return st.size() + 1;
}

int main() {
    freopen("exam.in", "r", stdin);
    freopen("exam.out", "w", stdout);

    ll l, r;
    while (cin >> l >> r) {
        cout << solve(r) - (l ? solve(l - 1) : 0);
    }

    return 0;
}