#include <iostream>
using namespace std;

int main() {
	int n, m;

	while(cin >> m, m) {
		cin >> n;
		int ans = 0;

		for(; m <= n; m++) {
			int tmp = m;
			while(!(tmp % 2)) tmp /= 2;
			while(!(tmp % 3)) tmp /= 3;
			while(!(tmp % 5)) tmp /= 5;
			if(tmp == 1)
				ans++;
		}

		cout << ans << endl;
	}
}