#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>

using namespace std;

int m, n;

int check(int num) {
    if (m <= num && num <= n) return 1;
    return 0;
}

int main (int argc, char *argv[]) {
    while (cin >> m >> n, m) {
        int base = 1;
        int ans = 0;
        for (int i = int(m/2); i  <= int(n/2); ++i)    {
            for (int j = int(m/3); j <= int(n/3); ++j) {
                for (int k = int(m/5); k <= int(n/5); ++k) {
                    ans += check(pow(2, i) * pow(3, j) * pow(5, k));
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}
