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

int cnt[1000001];
int main() {
	for (int i = 1; i <= 1000000; i++) {
		cnt[i] = cnt[i - 1];
		if (!(604661760000000000LL % (ll)i))cnt[i]++;
	}
	int m, n;
	while (scanf("%d", &m), m) {
		scanf("%d", &n);
		printf("%d\n", cnt[n] - cnt[m - 1]);
	}
}