S = input() print(sum([S.count(str(n)) * n for n in range(1, 10)]))