#include<stdio.h>
int main()
{
	int m,n,c,s2,s3,s5;
	while(scanf("%d",&m),m)
	{
		scanf("%d",&n);
		c=0;
		for(s2=1; s2<=n; s2*=2)
			for(s3=1; s2*s3<=n; s3*=3)
				for(s5=1; s2*s3*s5<=n; s5*=5)
					if(s2*s3*s5 >= m) c++;
		printf("%d\n",c);
	}
	return 0;
}