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