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

cnt = 0

for i in range(22,D+1):

    d = str(i)

    if int(d[1])>=2 and int(d[1])*int(d[0])<=M:

        cnt += 1

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

cnt = 0

for m in range(4,M+1):

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

        if d>=20:

            d = str(d)

            if int(d[1])>=2:

                if m==int(d[0])*int(d[1]):

                    cnt += 1

print(cnt)
M, D = list(map(int, input().split()))
cnt = 0
for i in range(22, D + 1):
    d = str(i)
    if int(d[1]) >= 2 and int(d[1]) * int(d[0]) <= M:
        cnt += 1
print(cnt)

M, D = list(map(int, input().split()))
cnt = 0
for m in range(4, M + 1):
    for d in range(1, D + 1):
        if d >= 20:
            d = str(d)
            if int(d[1]) >= 2:
                if m == int(d[0]) * int(d[1]):
                    cnt += 1
print(cnt)

-for i in range(22, D + 1): -    d = str(i) -    if int(d[1]) >= 2 and int(d[1]) * int(d[0]) <= M: -        cnt += 1 +for m in range(4, M + 1): +    for d in range(1, D + 1): +        if d >= 20: +            d = str(d) +            if int(d[1]) >= 2: +                if m == int(d[0]) * int(d[1]): +                    cnt += 1