#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
	long a, b;
	vector<long>l;
	while (true){
		cin >> a;
		if (a == 0)break;
		cin >> b;
		long pen;
		for (long i = a; i != b + 1; i++){
			if (i % 2 == 0) {
				i /= 2;
			}
			if (i % 3 == 0) {
				i /= 3;
			}
			if (i % 5 == 0) {
				i /= 5;
			}
			if (i == 0){
				pen += 1;
				continue;
			}
			if (i % 2 != 0 && i % 3 != 0 && i % 5 != 0)
				continue;
		}
		l.push_back(pen);
	}
	for (int i = 0; i < l.size(); i++)
	{
		cout << l[i] << endl;
	}
}