#include <stdio.h>
#include <iostream>

using namespace std;

bool check (int a)
{
	while (a % 2 == 0) {
		a /= 2;
	}

	while (a % 3 == 0) {
		a /= 3;
	}

	while (a % 5 == 0) {
		a /= 5;
	}

	if (a == 1) {
		return true;
	} else {
		return false;
	}

}

int main() {
	int m,n;
	int counter;

	while (cin >> m) {
		if (m == 0) {
			break;
		}
		else {
			cin >> n;
			counter = 0;
			for (int i = m; i <= n; i++) {
				if (check(i)) {
					counter++;
				}
			}
			cout << counter << endl;
		}
	}
	return 0;
}