#include<bits/stdc++.h>

using namespace std;

int main(){

  int m,n;

  while(cin>>m>>n, m || n){
	
	int count = 0;
	
	for(int i=m;i<=n;++i){

	  int result = i;
	  
	  while(1){

		if(result%2==0)
		  result = result/2;
		else if(result%3==0)
		  result = result/3;
		else if(result%5==0)
		  result = result/5;
		else
		  break;
	  }
	  
	  if(result == 1)
		count++;
	  
	}

	cout<<count<<endl;
	
  }
  
}

