S = list(input()) num = set(map(str, range(10))) l = [0]*10 for s in S: if s in num: l[int(s)] += 1 ans = sum(i*n for i, n in enumerate(l)) print(ans)