#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	long long m, n;
	vector<long long>l;
	while (cin >> m){
		if (m == 0)break;
		cin >> n;
		long long sum = 0;
		for (int i = m; i <=n; i++){
			if (2^22 * 3^15 * 5^10 % i == 0){
				sum++;
			}
		}
		l.push_back(sum);
	}
	for (long long i : l) {
		cout << i << endl;
	}
	char c;
	cin >> c;
}