S = input() total = 0 for i in S: if i.isdigit(): total+=int(i) else: continue if total: print(total) else: print(-1)