S = input() count = 0 for i in range(len(S)): count += int(S[i:i + 1]) print(count)