"""simple docstring"""





from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass
@dataclass
class        _snake_case   :
						snake_case__	     =	42
						snake_case__	     =	42

class        _snake_case   :






						def __init__(				self					:	Optional[int]							,    UpperCAmelCase					:	int			):
													__lowerCamelCase    :						Optional[int]						      =   [[] for _ in range(UpperCAmelCase			)]
													__lowerCamelCase    :						Dict						      =   size






						def __getitem__(				self					:	Any							,    UpperCAmelCase					:	List[Any]			):
													return iter(self._graph[vertex]			)






						@property
						def 					lowerCamelCase__   (				self					:	Optional[Any]			):
													return self._size






						def 					lowerCamelCase__   (				self					:	Optional[Any]							,    UpperCAmelCase					:	List[Any]							,    UpperCAmelCase					:	int							,    UpperCAmelCase					:	int			):






													if weight not in (0, 1):
																				raise ValueError("Edge weight must be either 0 or 1."			)

													if to_vertex < 0 or to_vertex >= self.size:
																				raise ValueError("Vertex indexes must be in [0; size)."			)

													self._graph[from_vertex].append(Edge(UpperCAmelCase							,    UpperCAmelCase			)			)







						def 					lowerCamelCase__   (				self					:	Union[str, Any]							,    UpperCAmelCase					:	List[str]							,    UpperCAmelCase					:	Tuple			):
													__lowerCamelCase    :						Optional[int]						      =   deque([start_vertex]			)
													__lowerCamelCase    :						Dict						      =   [None] * self.size
													__lowerCamelCase    :						List[Any]						      =   0

													while queue:
																				__lowerCamelCase    :						List[str]						      =   queue.popleft()
																				__lowerCamelCase    :						Optional[Any]						      =   distances[current_vertex]
																				if current_distance is None:
																											continue

																				for edge in self[current_vertex]:
																											__lowerCamelCase    :						str						      =   current_distance + edge.weight
																											__lowerCamelCase    :						Any						      =   distances[edge.destination_vertex]
																											if (
																											    isinstance(UpperCAmelCase							,    UpperCAmelCase			)
																											    and new_distance >= dest_vertex_distance
																											):
																																		continue
																											__lowerCamelCase    :						Optional[Any]						      =   new_distance
																											if edge.weight == 0:
																																		queue.appendleft(edge.destination_vertex			)
																											else:
																																		queue.append(edge.destination_vertex			)

													if distances[finish_vertex] is None:
																				raise ValueError("No path from start_vertex to finish_vertex."			)

													return distances[finish_vertex]


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())


