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