month = list(range(1, 13)) d1 = list(range(1, 29)) d2 = list(range(1, 31)) d3 = list(range(1, 32)) ans = 0 for i in month: if i == 2: for j in d1: q, mod = divmod(j, 10) if i == q + mod: ans += 1 elif i == 4 or i == 6 or i == 9 or i == 11: for j in d2: q, mod = divmod(j, 10) if i == j + mod: ans += 1 else: for j in d3: q, mod = divmod(j, 10) if i == q + mod: ans += 1 print(ans)