#include <iostream>
#include <cmath>
using namespace std;

int main() {
    while (true) {
        int start, end;
        cin >> start >> end;
        if (start == 0) {
            break;
        }
        int count = 0;
        for (int i = start; i <= end; i++) {
            int temp = i;
            while (temp > 1) {
                if (temp % 2 == 0) {
                    temp /= 2;
                } else if (temp % 3 == 0) {
                    temp /= 3;
                } else if (temp % 5 == 0) {
                    temp /= 5;
                } else {
                    break;
                }
            }
            if (temp == 1) {
                count++;
            }
        }
        cout << count << endl;
    }
}