#include <iostream>
using namespace std;

int main(){
	int n,m,ret,c;
	while(cin >> n && n){
		cin >> m;
		ret = 0;
		for(int i=n;i<=m;i++){
			c = i;
			while(c%2==0){
				c/=2;
			}
			while(c%3==0){
				c/=3;
			}
			while(c%5==0){
				c/=5;
			}
			if(c==1)ret++;
		}
		cout << ret << endl;
	}
}