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