s=input() r=0 for i in range(1,10): c=s.count(str(i)) r+=c*i print(r)