#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

ll solve(const ll m, const ll n) {
    queue<ll> q2;
    queue<ll> q3;
    queue<ll> q5;

    // 1 is always included.
    ll count = 0;
    q2.push(1);

    while (1) {
        ll cand;
        if (q2.size() > 0) cand = q2.front();
        if (q3.size() > 0) cand = min(cand, q3.front());
        if (q5.size() > 0) cand = min(cand, q5.front());

        if (q2.front() == cand) {
            q2.pop();
            q2.push(2 * cand);
            q3.push(3 * cand);
            q5.push(5 * cand);
        } else if (q3.front() == cand) {
            q3.pop();
            q3.push(3 * cand);
            q5.push(5 * cand);
        } else {
            q5.pop();
            q5.push(5 * cand);
        }

        if (m <= cand && cand <= n) {
            count++;
        }
        if (cand > n) {
            break;
        }
    }

    return count;
}

int main(void) {
    ll m, n;

    while (1) {
        cin >> m;
        if (m == 0) return 0;
        cin >> n;

        cout << solve(m, n) << endl;
    }
    
    return 0;
}

