"""simple docstring"""





class        _snake_case   :






						def __init__(				self					:	Optional[int]							,    UpperCAmelCase					:	Any							,    UpperCAmelCase					:	Union[str, Any]=None							,    UpperCAmelCase					:	Any=None			):
													__lowerCamelCase    :						Optional[int]						      =   data
													__lowerCamelCase    :						int						      =   previous
													__lowerCamelCase    :						List[Any]						      =   next_node






						def __str__(				self					:	int			):
													return F"""{self.data}"""






						def 					lowerCamelCase__   (				self					:	List[str]			):
													return self.data






						def 					lowerCamelCase__   (				self					:	Optional[Any]			):
													return self.next







						def 					lowerCamelCase__   (				self					:	List[Any]			):
													return self.previous

class        _snake_case   :






						def __init__(				self					:	Tuple							,    UpperCAmelCase					:	List[Any]			):
													__lowerCamelCase    :						List[Any]						      =   head






						def __iter__(				self					:	Optional[Any]			):
													return self







						def 					lowerCamelCase__   (				self					:	List[str]			):






													if not self.current:
																				raise StopIteration
													else:
																				__lowerCamelCase    :						List[Any]						      =   self.current.get_data()
																				__lowerCamelCase    :						List[Any]						      =   self.current.get_next()
																				return value

class        _snake_case   :






						def __init__(				self					:	Any			):
													__lowerCamelCase    :						Optional[int]						      =   None  # First node in list
													__lowerCamelCase    :						Tuple						      =   None  # Last node in list






						def __str__(				self					:	str			):
													__lowerCamelCase    :						List[str]						      =   self.head
													__lowerCamelCase    :						Tuple						      =   []
													while current is not None:
																				nodes.append(current.get_data()			)
																				__lowerCamelCase    :						Any						      =   current.get_next()
													return " ".join(str(UpperCAmelCase			) for node in nodes			)






						def __contains__(				self					:	Optional[int]							,    UpperCAmelCase					:	int			):
													__lowerCamelCase    :						Union[str, Any]						      =   self.head
													while current:
																				if current.get_data() == value:
																											return True
																				__lowerCamelCase    :						Dict						      =   current.get_next()
													return False






						def __iter__(				self					:	Any			):
													return LinkedListIterator(self.head			)






						def 					lowerCamelCase__   (				self					:	Optional[Any]			):






													if self.head:
																				return self.head.get_data()
													return None






						def 					lowerCamelCase__   (				self					:	Dict			):






													if self.tail:
																				return self.tail.get_data()
													return None






						def 					lowerCamelCase__   (				self					:	int							,    UpperCAmelCase					:	Union[str, Any]			):






													if self.head is None:
																				__lowerCamelCase    :						str						      =   node
																				__lowerCamelCase    :						int						      =   node
													else:
																				self.insert_before_node(self.head							,    UpperCAmelCase			)






						def 					lowerCamelCase__   (				self					:	List[str]							,    UpperCAmelCase					:	List[str]			):






													if self.head is None:
																				self.set_head(UpperCAmelCase			)
													else:
																				self.insert_after_node(self.tail							,    UpperCAmelCase			)






						def 					lowerCamelCase__   (				self					:	Optional[Any]							,    UpperCAmelCase					:	List[Any]			):
													__lowerCamelCase    :						Tuple						      =   Node(UpperCAmelCase			)
													if self.head is None:
																				self.set_head(UpperCAmelCase			)
													else:
																				self.set_tail(UpperCAmelCase			)






						def 					lowerCamelCase__   (				self					:	Union[str, Any]							,    UpperCAmelCase					:	Optional[Any]							,    UpperCAmelCase					:	Union[str, Any]			):
													__lowerCamelCase    :						str						      =   node
													__lowerCamelCase    :						str						      =   node.previous

													if node.get_previous() is None:
																				__lowerCamelCase    :						Any						      =   node_to_insert
													else:
																				__lowerCamelCase    :						Optional[Any]						      =   node_to_insert

													__lowerCamelCase    :						Any						      =   node_to_insert






						def 					lowerCamelCase__   (				self					:	List[str]							,    UpperCAmelCase					:	List[Any]							,    UpperCAmelCase					:	Union[str, Any]			):
													__lowerCamelCase    :						Optional[int]						      =   node
													__lowerCamelCase    :						str						      =   node.next

													if node.get_next() is None:
																				__lowerCamelCase    :						int						      =   node_to_insert
													else:
																				__lowerCamelCase    :						Tuple						      =   node_to_insert

													__lowerCamelCase    :						Optional[Any]						      =   node_to_insert






						def 					lowerCamelCase__   (				self					:	str							,    UpperCAmelCase					:	Tuple							,    UpperCAmelCase					:	Any			):
													__lowerCamelCase    :						List[Any]						      =   1
													__lowerCamelCase    :						Tuple						      =   Node(UpperCAmelCase			)
													__lowerCamelCase    :						List[Any]						      =   self.head
													while node:
																				if current_position == position:
																											self.insert_before_node(UpperCAmelCase							,    UpperCAmelCase			)
																											return
																				current_position += 1
																				__lowerCamelCase    :						int						      =   node.next
													self.insert_after_node(self.tail							,    UpperCAmelCase			)






						def 					lowerCamelCase__   (				self					:	Union[str, Any]							,    UpperCAmelCase					:	int			):
													__lowerCamelCase    :						Dict						      =   self.head
													while node:
																				if node.get_data() == item:
																											return node
																				__lowerCamelCase    :						Dict						      =   node.get_next()
													raise Exception("Node not found"			)






						def 					lowerCamelCase__   (				self					:	int							,    UpperCAmelCase					:	Dict			):






													if (node := self.get_node(UpperCAmelCase			)) is not None:
																				if node == self.head:
																											__lowerCamelCase    :						Union[str, Any]						      =   self.head.get_next()

																				if node == self.tail:
																											__lowerCamelCase    :						Union[str, Any]						      =   self.tail.get_previous()

																				self.remove_node_pointers(UpperCAmelCase			)






						@staticmethod
						def 					lowerCamelCase__   (				UpperCAmelCase					:	List[str]			):






													if node.get_next():
																				__lowerCamelCase    :						int						      =   node.previous

													if node.get_previous():
																				__lowerCamelCase    :						Optional[Any]						      =   node.next

													__lowerCamelCase    :						Optional[int]						      =   None
													__lowerCamelCase    :						Optional[Any]						      =   None







						def 					lowerCamelCase__   (				self					:	Optional[int]			):
													return self.head is None


def       lowercase_      (      )       ->					None:



							'''simple docstring'''






if __name__ == "__main__":
				import doctest

				doctest.testmod()


import os
def      a      (			)    ->      Any:





      """simple docstring"""



      with open(os.path.dirname(A__     ) + '/p022_names.txt'     ) as file:
            _lowercase	       =str(file.readlines()[0]     )
            _lowercase	       =names.replace('"'      ,   ''     ).split(','     )

      names.sort()

      _lowercase	       =0
      _lowercase	       =0

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

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


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


