#include <iostream>
#include <memory>
#include <memory.h>
#include <cmath>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
#define USE_MATH_DEFINES
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

bool nums[2000000];

int main(){
	memset(nums, false, sizeof(nums));
	nums[1] = true;
	rep2(i, 2, 2000000){
		if(i % 2 == 0 && nums[i/2]) nums[i] = true;
		if(i % 3 == 0 && nums[i/3]) nums[i] = true;
		if(i % 5 == 0 && nums[i/5]) nums[i] = true;
	}
	int m, n;
	while(cin >> m && m){
		int cnt = 0;
		cin >> n;
		rep2(i, m, n + 1) if(nums[i]) cnt++;
		cout << cnt << endl;
	}
	return 0;
}