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

#define MAX 1000000

int main()
{
	int i, j, k;
	int a, b;
	vector<int> h(MAX+1);
	for (i = 1; i <= MAX; i *= 2) {
		h[i] = 1;
		for (j = 1; i*j <= MAX; j *= 3) {
			h[i*j] = 1;
			for (k = 5; i*j*k <= MAX; k *= 5) {
				h[i*j*k] = 1;
			}
		}
	}

	while (cin>>a>>b, a) {
		k = 0;
		for (i = a; i <= b; i++)
			if (h[i]) k++;
		cout<<k<<endl;
	}
	return 0;
}