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