# coding: utf-8 import calendar month = 12 y = 2015 happy_ct = 0 for i in range(1,month + 1): last_day_num = calendar.monthrange(y,i)[1] for j in range(1,last_day_num): j_1 = j // 10 j_2 = j % 10 j_sum = j_1 + j_2 if i == j_sum: happy_ct += 1 print(happy_ct)