// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;

#define MP make_pair
#define fastIO	cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c)	for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(), c_end=c.end(); it!=c_end; ++it)

bool solve2(int i){
	while (i % 5 == 0)	i /= 5;
	while (i % 3 == 0)	i /= 3;
	while (i % 2 == 0)	i /= 2;
	if (i == 1)	return true;
	return false;
}

int main(){
	// respect http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=226655#1
	fastIO;
	int m = 0, n = 0, out = 0;

	while (cin >> m, m){
		cin >> n;
		out = 0;
		for (int i = m; i <= n; i++)
			if (solve2(i))
				out++;
		cout << out << endl;
	}
	return 0;
}