import sys input=lambda: sys.stdin.readline().rstrip() ans=0 M=[31,28,31,30,31,30,31,31,30,31,30,31] for i in range(12): for j in range(1,M[i]+1): d=0 for k in str(j): d+=int(k) if i+1==d: ans+=1 print(ans)