S=input() N=int(len(S)) S= list(S) for i in range(0, N): S[i]=int(S[i]) sum=0 for i in S: sum += i print(sum)