happy_day = 0 for i in range(12): if i == 0 or i == 2 or i == 4 or i == 6 or i == 7 or i == 9 or i ==11: for j in range(31): if i+1 == (j+1) // 10 + (j+1) % 10: happy_day += 1 elif i == 1: for j in range(28): if i+1 == (j+1) // 10 + (j+1) % 10: happy_day += 1 else: for j in range(30): if i+1 == (j+1) // 10 + (j+1) % 10: happy_day += 1 print(happy_day)