import sys readline=sys.stdin.readline import datetime date=datetime.date(2015,1,1) ans=0 while date.year==2015: if date.month==sum(map(int,list(str(date.day)))): ans+=1 date+=datetime.timedelta(days=1) print(ans)