#include <cstdio>
using namespace std;

const int lim = 1000010;

int dp[lim];

int main(){
	for(int s = 1; s < lim; s *= 5){
		for(int t = s; t < lim; t *= 3){
			for(int u = t; u < lim; u *= 2){
				dp[u] = 1;
			}
		}
	}
	for(int i = 1; i < lim; ++i){
		dp[i] += dp[i - 1];
	}

	int x, y;
	while(scanf("%d%d", &x, &y) == 2){
		printf("%d\n", dp[y] - dp[x - 1]);
	}
}