#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define N 100
using namespace std;
int main(){
	bool hamming[N]={false};
	hamming[1] = true;
	for(int j=2;j<N;j++){
		int i=j;
		while(i%2==0) i /= 2;
		while(i%3==0) i /= 3;
		while(i%5==0) i /= 5;
		if(i==1) hamming[j] = true;
	}

	int m,n;
	while(1){
		cin>>m;
		if(m == 0) break;
		cin>>n;

		int count=0;
		for(int i=m;i<=n;i++)
			if(hamming[i])
				count++;
		
		cout<<count<<endl;
	}

	return 0;
}