Problem:
Today is August 24, one of the five Product Days in a year.  A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):    * d_1 \geq 2   * d_{10} \geq 2   * d_1 \times d_{10} = m  Takahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.  In Takahashi Calendar, how many Product Days does a year have?

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 24 21:04:16 2019

@author: Toroi0610
"""

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

M, D = map(int, "15 40".split())
#d_1, d_10 = int(D[0]), int(D[1])
day = [str(d) for d in range(1, D)]
cnt = 0
for m in range(1, M+1):
    s = make_divisors(m)
    length = len(s)
    if length == 1:
        continue
    if length%2 == 0:
        for l, r in zip(s[:int(length/2)], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    print(m, l, r)
                    cnt += 1
                if str(r)+str(l) in day:
                    print(m, r, l)
                    cnt += 1
    else:
        for l, r in zip(s[:int(length/2)+1], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    print(m, l, r)
                    cnt += 1
                if l != r:
                    if str(r)+str(l) in day:
                        print(m, r, l)
                        cnt += 1
        


Fixed, accepted submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 24 21:04:16 2019

@author: Toroi0610
"""

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

M, D = map(int, input().split())
day = [str(d) for d in range(1, D+1)]
cnt = 0
for m in range(1, M+1):
    s = make_divisors(m)
    length = len(s)
    if length == 2:
        continue
    if length%2 == 0:
        for l, r in zip(s[:int(length/2)], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    cnt += 1
                if str(r)+str(l) in day:
                    cnt += 1
    else:
        for l, r in zip(s[:int(length/2)+1], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    cnt += 1
                if l != r:
                    if str(r)+str(l) in day:
                        cnt += 1
print(cnt)