S = str(input()) a = 0 for i in S: for j in range(10): if str(j) == S[i]: a = a + j print(a)