M,D = list(map(int, input().split()))



D = int(D)

ans = 0



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

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

        j = str(j)

        if len(j) == 2:

            j1 = int(j[0])

            j2 = int(j[1])

            if j1 >= 2 and j2 >= 2 and j1 * j2 == i:

                ans += 1





print(ans)

M,D = list(map(int, input().split()))



ans = 0



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

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

        j1 = j // 10

        j2 = j % 10

        if j1 >= 2 and j2 >= 2 and j1 * j2 == i:

            ans += 1





print(ans)
M, D = list(map(int, input().split()))
D = int(D)
ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        j = str(j)
        if len(j) == 2:
            j1 = int(j[0])
            j2 = int(j[1])
            if j1 >= 2 and j2 >= 2 and j1 * j2 == i:
                ans += 1
print(ans)

M, D = list(map(int, input().split()))
ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        j1 = j // 10
        j2 = j % 10
        if j1 >= 2 and j2 >= 2 and j1 * j2 == i:
            ans += 1
print(ans)

-D = int(D) -        j = str(j) -        if len(j) == 2: -            j1 = int(j[0]) -            j2 = int(j[1]) -            if j1 >= 2 and j2 >= 2 and j1 * j2 == i: -                ans += 1 +        j1 = j // 10 +        j2 = j % 10 +        if j1 >= 2 and j2 >= 2 and j1 * j2 == i: +            ans += 1