s=int(input()) a=0 for i in range(10): a+=i*s.count(str(i)) print(a)