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