from datetime import date,timedelta delta = timedelta(days=0) ans = 0 for i in range(365): d = date(2015,1,1) + delta if(d.month == (d.day / 10) + (d.day % 10)):ans += 1 delta += timedelta(days=1) print ans