#include <vector>
#include <iostream>

using namespace std;

unsigned long long power(int a, int b)
{
	if (b == 0) { return 1LL; }

	return power(a, b - 1) * a;
}

int main()
{
	vector<bool> s(1000001, false);

	for (int i = 0; i < 22; i++)
	{
		for (int j = 0; j < 14; j++)
		{
			for (int k = 0; k < 10; k++)
			{
				unsigned long long sum = power(2, i) * power(3, j) * power(5, k);

				if (sum <= 1000000ULL)
				{
					s[sum] = true;
				}
			}
		}
	}

	int m, n;

	while (cin >> m >> n)
	{
		int sum = 0;

		for (int i = m; i <= n; i++)
		{
			sum += (s[i] ? 1 : 0);
		}

		cout << sum << endl;
	}

	return 0;
}