#include <iostream>

using namespace std;

int is_haming(int num)
{
	while (num % 2 == 0) num /= 2;
	while (num % 3 == 0) num /= 3;
	while (num % 5 == 0) num /= 5;

	if (num == 1) return (1);
	else return (0);
}

int main()
{
	int n, m;

	while (cin >> n, n){
		cin >> m;

		int count = 0;
		for (int i = n; i <= m; i++){
			count += is_haming(i);
		}

		cout << count << endl;
	}

	return 0;
}