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

int x[2000000];
long long p;
int a, b, sum;

int main() {
	for (int i = 0; i < 20; i++) {
		for (int j = 0; j < 13; j++) {
			for (int k = 0; k < 9; k++) {
				p = (long long)pow(2, i)*(long long)pow(3, j)*(long long)pow(5, k);
				if (p < 2000000) {
					x[p] = 1;
				}
			}
		}
	}
	while (true) {
		sum = 0;
		cin >> a;
		if (a == 0) { break; }
		cin >> b;
		for (int i = a; i <= b; i++){
			sum += x[i];
		}
		cout << sum << endl;
	}
}