#include <iostream>
using namespace std;

const int MAX = 1000001;
char p[MAX] = {};
inline void foo(int n){
	if( n >= MAX || p[n] ) return;
	p[n] = 1;
	foo(n*2);
	foo(n*3);
	foo(n*5);
}

int main(){
	int n,m;
	foo(1);

	while( cin >> m >> n ){
		int ans = 0;
		for(int i=m ; i<=n ; ++i ){
			if( p[i] )
				++ans;
		}
		cout << ans << endl;
	}
}