S = str(input()) num = 0 for i in range(10): num += S.count(str(i)) * i print(num)