import sys import datetime def main(): my_date = datetime.date(2015,1,1) day_counter = 0 for i in range(365): adding_date = datetime.timedelta(days=i) target_date = my_date+adding_date num1 = int(target_date.day)%10 num2 = int(target_date.day)//10 num3 = int(target_date.month) if num3 == num1+num2: #print(target_date) day_counter += 1 print(day_counter) if __name__ == "__main__": main()