#include<iostream>
#include<cstring>
#define INF 1000001
using namespace std;
int main(){
	int m,n;
	bool HAM[INF];
	memset(HAM,false,sizeof(HAM));
	for(int i=1;i<INF;i*=2){
		for(int j=i;j<INF;j*=3){
			for(int k=j;k<INF;k*=5){
				HAM[k] = true;
			}
		}
	}
	while(cin >> m&&m){
		cin >> n;
		int cnt=0;
		for(int i=m;i<=n;i++){
			if(HAM[i]) cnt++;
		}
		cout << cnt << endl;
	}
}