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