m,d = list(map(int,input().split()))





cnt = 0

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

    for j in range(1,d+1):

        #print(i,j)

        num = 1

        d2 = (j-j%10)//10

        d1 = j%10

        if d2 >=2 and d1 >=2:

            num =d1*d2

            #print(i,j,num,d1,d2)

        #print(i,j,num,(j-j%10),j%10)

            if num == i:

                cnt +=1

print(cnt)
m,n = list(map(int,input().split()))



cnt = 0

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

    for j in range(10,n+1):

        num = 1

        d = str(j)

        l = len(d)

        

        for k in range(l):

            if int(d[k]) < 2:

                num =1

                break

            else:

                num *=int(d[k])

        if num == i and num !=1:

            cnt +=1

print(cnt)
m, d = list(map(int, input().split()))
cnt = 0
for i in range(1, m + 1):
    for j in range(1, d + 1):
        # print(i,j)
        num = 1
        d2 = (j - j % 10) // 10
        d1 = j % 10
        if d2 >= 2 and d1 >= 2:
            num = d1 * d2
            # print(i,j,num,d1,d2)
            # print(i,j,num,(j-j%10),j%10)
            if num == i:
                cnt += 1
print(cnt)

m, n = list(map(int, input().split()))
cnt = 0
for i in range(1, m + 1):
    for j in range(10, n + 1):
        num = 1
        d = str(j)
        l = len(d)
        for k in range(l):
            if int(d[k]) < 2:
                num = 1
                break
            else:
                num *= int(d[k])
        if num == i and num != 1:
            cnt += 1
print(cnt)

-m, d = list(map(int, input().split())) +m, n = list(map(int, input().split())) -    for j in range(1, d + 1): -        # print(i,j) +    for j in range(10, n + 1): -        d2 = (j - j % 10) // 10 -        d1 = j % 10 -        if d2 >= 2 and d1 >= 2: -            num = d1 * d2 -            # print(i,j,num,d1,d2) -            # print(i,j,num,(j-j%10),j%10) -            if num == i: -                cnt += 1 +        d = str(j) +        l = len(d) +        for k in range(l): +            if int(d[k]) < 2: +                num = 1 +                break +            else: +                num *= int(d[k]) +        if num == i and num != 1: +            cnt += 1