while True:

	inp = input()

	if inp == "0": break

	m,n = list(map(int, inp.split()))

	ans = 0

	for i in range(m,n+1):

		while i > 1:

			if i%2 == 0:

				i /= 2

			elif i%3 == 0:

				i /= 3

			elif i%5 == 0:

				i /= 5

			else:

				break

		else:

			ans += 1

	print(ans)
def ham2(a):

	global m,n,count

	if m <= a:

		count += 1

	a2,a3,a5 = a*2, a*3, a*5

	if a2 <= n: ham2(a2)

	if a3 <= n:	ham3(a3)

	if a5 <= n:	ham5(a5)



def ham3(a):

	global m,n,count

	if m <= a:

		count += 1

	a3,a5 = a*3, a*5

	if a3 <= n:	ham3(a3)

	if a5 <= n:	ham5(a5)

	

def ham5(a):

	global m,n,count

	if m <= a:

		count += 1

	a5 = a*5

	if a5 <= n:	ham5(a5)



while True:

	inp = input()

	if inp == "0": break

	m,n = list(map(int, inp.split()))

	count = 0

	ham2(1)

	print(count)
while True:
    inp = input()
    if inp == "0":
        break
    m, n = list(map(int, inp.split()))
    ans = 0
    for i in range(m, n + 1):
        while i > 1:
            if i % 2 == 0:
                i /= 2
            elif i % 3 == 0:
                i /= 3
            elif i % 5 == 0:
                i /= 5
            else:
                break
        else:
            ans += 1
    print(ans)

def ham2(a):
    global m, n, count
    if m <= a:
        count += 1
    a2, a3, a5 = a * 2, a * 3, a * 5
    if a2 <= n:
        ham2(a2)
    if a3 <= n:
        ham3(a3)
    if a5 <= n:
        ham5(a5)


def ham3(a):
    global m, n, count
    if m <= a:
        count += 1
    a3, a5 = a * 3, a * 5
    if a3 <= n:
        ham3(a3)
    if a5 <= n:
        ham5(a5)


def ham5(a):
    global m, n, count
    if m <= a:
        count += 1
    a5 = a * 5
    if a5 <= n:
        ham5(a5)


while True:
    inp = input()
    if inp == "0":
        break
    m, n = list(map(int, inp.split()))
    count = 0
    ham2(1)
    print(count)

+def ham2(a): +    global m, n, count +    if m <= a: +        count += 1 +    a2, a3, a5 = a * 2, a * 3, a * 5 +    if a2 <= n: +        ham2(a2) +    if a3 <= n: +        ham3(a3) +    if a5 <= n: +        ham5(a5) + + +def ham3(a): +    global m, n, count +    if m <= a: +        count += 1 +    a3, a5 = a * 3, a * 5 +    if a3 <= n: +        ham3(a3) +    if a5 <= n: +        ham5(a5) + + +def ham5(a): +    global m, n, count +    if m <= a: +        count += 1 +    a5 = a * 5 +    if a5 <= n: +        ham5(a5) + + -    ans = 0 -    for i in range(m, n + 1): -        while i > 1: -            if i % 2 == 0: -                i /= 2 -            elif i % 3 == 0: -                i /= 3 -            elif i % 5 == 0: -                i /= 5 -            else: -                break -        else: -            ans += 1 -    print(ans) +    count = 0 +    ham2(1) +    print(count)