#include <iostream>
using namespace std;

bool hum[1000001];

int main(void)
{
	hum[1] = true;
	for(int i = 2; i <= 1000000; i *= 2)
		hum[i] = true;
	for(int i = 3; i <= 1000000; i *= 3)
		hum[i] = true;
	for(int i = 5; i <= 1000000; i *= 5)
		hum[i] = true;

	for(int i = 0; i <= 1000000; i++){
		if(hum[i]){
			for(int j = i; j <= 1000000; j *= 3)
				hum[j] = true;
			for(int j = i; j <= 1000000; j *= 5)
				hum[j] = true;
			for(int j = i; j <= 1000000; j *= 2)
				hum[j] = true;
		}
	}
	int n,m;
	while(cin >> n, n){
		cin >> m;
		int c = 0;
		for(int i = n; i <= m; i++)
			if(hum[i])
				c++;
		cout << c << endl;
	}


	return 0;
}