#include<iostream>
#include<set>
#include<string>
using namespace std;
int main() {
	set<long long>a;
	long long b, c,sum = 1;
	for (int i = 0; i <= 19; i++) {
		b = sum;
		for (int j = 0; j <= 12; j++) {
			c = sum;
			if (sum > 1000000)
				break;
			for (int z = 0; z <= 8; z++) {
				a.insert(sum);
				if (sum > 1000000)
					break;
				sum *= 5;
			}
			sum = c;
			sum *= 3;
		}
		sum = b;
		sum *= 2;
	}
	int m, n,o=0;
	string d, h = "";
	while (getline(cin, d)) {
		o = 0;
		if (d.length() == 1) break;
		d += " ";
		h = "";
		for (int i = 0; i < d.length(); i++) {
			if (d[i] == ' ') {
				if (o == 0){ m = atoi(h.c_str());}
				else {n = atoi(h.c_str());}
				o++;
				h = "";
			}
			else
				h += d[i];
		}
		set<long long>::iterator it = a.begin();
		int sum = 0;
		while ((*it) < m) {
			it++;
			if (it == a.end()){ break;}
		}
		while ((*it) >= m && (*it) <= n)
		{
			it++;
			sum++;
			if (it == a.end()) {break;}
		}
		cout << sum << endl;
	}
}