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