month = [] cnt = 0 for i in range(1,13): month.append(i) for i in range(1,31): i = list(str(i).rjust(2,"0")) cnt += month.count(int(i[0]) + int(i[1])) print(cnt)