#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	int m, n;
	while (cin >> m, m) {
		cin >> n;
		int ans = 0;
		for (int i = 1; i <= n; i *= 2)
			for (int j = i; j <= n; j *= 3)
				for (int k = j; k <= n; k *= 5)
					if (k >= m) ans++;
		cout << ans << endl;
	}
	return 0;
}