c=0 s=sorted(list(input())) for i in s: if i.isnumeric(): c+=int(i) else: break print(c)