#include <iostream>
using namespace std;
bool is_hamming(int n){
	
}
int main(){
	while(1){
		int num=0,num1,num2;
		cin>>num1;
		if(num1==0)
			return 0;
		cin>>num2;
		for(int i=num2;num1<=i;i--){
			int j=i;
			while(j%5==0)
				j=j/5;
			while(j%3==0)
				j=j/3;
			while(j%2==0)
				j=j/2;
			if(j==1)
				++num;
			
		}
		cout<<num<<endl;
	}
	return 0;
}