#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;

vector<int> hamming_numbers;
int m, n;

void print_vi(vector<int> vi)
{
	rep(i, vi.size())
	{
		printf("%d ", vi[i]);
	}
}

signed main()
{
	rep(i,21) rep(j,13) rep(k,9)
	{
		int num = pow(2, i) * pow(3, j) * pow(5, k);
		if (num <= 1000000)
		{
			hamming_numbers.push_back(num);
		}
	}

	sort(hamming_numbers.begin(), hamming_numbers.end());

	//print_vi(hamming_numbers);

	while (cin >> m >> n)
	{
		cout << distance(lower_bound(hamming_numbers.begin(), hamming_numbers.end(), m), upper_bound(hamming_numbers.begin(), hamming_numbers.end(), n)) << endl;
	}
}