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

ans = 0

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

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

    if j < 22:

      continue

    else:

      j = str(j)

      d1 = int(j[0])

      d2 = int(j[1])

      if d1>=2 and d2>=2 and i == d1*d2:

        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):

    if j//10 >=2 and j%10 >=2 and i == (j//10)*(j%10):

        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):
        if j < 22:
            continue
        else:
            j = str(j)
            d1 = int(j[0])
            d2 = int(j[1])
            if d1 >= 2 and d2 >= 2 and i == d1 * d2:
                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):
        if j // 10 >= 2 and j % 10 >= 2 and i == (j // 10) * (j % 10):
            ans += 1
print(ans)

-        if j < 22: -            continue -        else: -            j = str(j) -            d1 = int(j[0]) -            d2 = int(j[1]) -            if d1 >= 2 and d2 >= 2 and i == d1 * d2: -                ans += 1 +        if j // 10 >= 2 and j % 10 >= 2 and i == (j // 10) * (j % 10): +            ans += 1