




import enum
import shutil
import sys


__UpperCamelCase   ,    __UpperCamelCase   :			Any          = shutil.get_terminal_size()

__UpperCamelCase   :			str          = {"UP": "A", "DOWN": "B", "RIGHT": "C", "LEFT": "D"}

class 						__lowerCAmelCase      (      enum.Enum					):
							UpperCamelCase__   	=    0
							UpperCamelCase__   	=    1







def 						__A						(      __lowerCamelCase				,     __lowerCamelCase=""       ) ->			int:
	sys.stdout.write(str(__lowerCamelCase       ) + end       )
	sys.stdout.flush()





def 						__A						(      __lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase=""       ) ->			Optional[Any]:
	forceWrite(f'\u001b[{color}m{content}\u001b[0m'				,     __lowerCamelCase       )





def 						__A						(      ) ->			List[str]:
	forceWrite("""\r"""       )





def 						__A						(      __lowerCamelCase				,     __lowerCamelCase       ) ->			str:
	forceWrite(f'\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'       )





def 						__A						(      ) ->			Tuple:
	forceWrite(""" """ * TERMINAL_WIDTH       )
	reset_cursor()





def 						__A						(      ) ->			Optional[Any]:
	reset_cursor()
	forceWrite("""-""" * TERMINAL_WIDTH       )







import os





def 						__A						(      ) ->			Dict:
	with open(os.path.dirname(__lowerCamelCase       ) + """/p022_names.txt"""       ) as file:
		a									=				str(file.readlines()[0]       )
		a									=				names.replace("""\""""				,     """"""       ).split(""","""       )

	names.sort()

	a									=				0
	a									=				0

	for i, name in enumerate(__lowerCamelCase       ):
		for letter in name:
			name_score += ord(__lowerCamelCase       ) - 64

		total_score += (i + 1) * name_score
		a									=				0
	return total_score


if __name__ == "__main__":
		print(solution())

