






import os




def 				A		(					)		-> Optional[int]:


	with open(os.path.dirname(lowercase__  ) + """/p022_names.txt"""  ) as file:
		UpperCamelCase__ :Any						=      str(file.readlines()[0]  )
		UpperCamelCase__ :Tuple						=      names.replace("""\"""" ,		""""""  ).split(""","""  )

	names.sort()

	UpperCamelCase__ :List[Any]						=      0
	UpperCamelCase__ :List[Any]						=      0

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

		total_score += (i + 1) * name_score
		UpperCamelCase__ :int						=      0
	return total_score


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

def  __snake_case							(	__magic_name__						):







				'''simple docstring'''


				lowercase         =      set()
				# To detect a back edge, keep track of vertices currently in the recursion stack
				lowercase         =      set()
				return any(
				    node not in visited and depth_first_search(__magic_name__		,    __magic_name__		,    __magic_name__		,    __magic_name__						)
				    for node in graph						)

def  __snake_case							(	__magic_name__		,    __magic_name__		,    __magic_name__		,    __magic_name__						):







				'''simple docstring'''


				visited.add(__magic_name__						)
				rec_stk.add(__magic_name__						)

				for node in graph[vertex]:
								if node not in visited:
												if depth_first_search(__magic_name__		,    __magic_name__		,    __magic_name__		,    __magic_name__						):
																return True
								elif node in rec_stk:
												return True

    # The node needs to be removed from recursion stack before function ends
				rec_stk.remove(__magic_name__						)
				return False


if __name__ == "__main__":
						from doctest import testmod

						testmod()
