#include<iostream>
using namespace std;

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