days = [31,28,31,30,31,30,31,31,30,31,30,31] count = 0 for i in range(1,13): for j in range(1, days[i-1]+1): if j < 10: if j == i: count += 1 else: ten, one = [int(x) for x in str(j)] if ten + one == i: count += 1 print(count)