days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] happy_day = 0 for i in range(len(days)): for j in range(days[i]): if i + 1 == j // 10 + j % 10: happy_day += 1 print(happy_day)