S = list(input())
total = 0
for i in range(1, 10):
    total += i * S.count(str(i))
print(total)