#include<iostream>
using namespace std;
int main(){
	int m,n,ans;
	while(cin>>m,m){
		cin>>n;
		ans=0;
	for(int i=1;i<=n;i*=5)
	for(int j=i;j<=n;j*=3)
	for(int k=j;k<=n;k*=2){
		if(k>=m)
		ans++;
	}
		cout<<ans<<endl;
	}
	return 0;
}