#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {
	int m,n,count=0,a;
	while(true){
		cin>>m;
		if(m==0){
			break;
		}
		else{
			cin>>n;
			for(int i=m;i<n+1;i++){
				a=i;
				while(true){
					if(a%2==0){
					a/=2;
					}
					if(a%3==0){
					a/=3;
					}
					if(a%5==0){
					a/=5;
					}
					if(a%2!=0&&a%3!=0&&a%5!=0){
					break;
					}
				}
					if(a==1){
					count++;
					}
			}
			cout<<count<<endl;
			count=0;
		}
	}
}