import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) s = read().rstrip().decode() al = [chr(ord('a') + i) for i in range(26)] cnt = 0 for check in list(s): if check not in al: cnt += int(check) print(cnt)