a=input();print(sum(i*a.count(str(i)))for i in range(10))