



"""simple docstring"""







import os

def     UpperCamelCase_   (   )						->       Optional[Any]:

  """simple docstring"""




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

  names.sort()

  lowerCAmelCase_       :    List[Any]								=			0
  lowerCAmelCase_       :    List[Any]								=			0

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

    total_score += (i + 1) * name_score
    lowerCAmelCase_       :    List[str]								=			0
  return total_score


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










"""simple docstring"""







from collections.abc import Iterable
from typing import Generic, TypeVar

lowercase__		:    Any				   =     TypeVar("""_T""")







class 				UpperCamelCase__       (     Generic[_T]  ):




      """simple docstring"""




      def __init__(				self    :				Any   ,      SCREAMING_SNAKE_CASE_    :				Iterable[_T] | None = None	):
        lowerCAmelCase_       :    list[_T]								=			list(iterable or []	)
        lowerCAmelCase_       :    list[_T]								=			[]



      def __len__(				self    :				List[str]	):
        return len(self._stacka	) + len(self._stacka	)



      def __repr__(				self    :				int	):
        return F"Queue({tuple(self._stacka[::-1] + self._stacka	)})"



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Tuple   ,      SCREAMING_SNAKE_CASE_    :				_T	):
        self._stacka.append(SCREAMING_SNAKE_CASE_	)





      def 					SCREAMING_SNAKE_CASE__			(				self    :				str	):
        lowerCAmelCase_       :    List[str]								=			self._stacka.pop
        lowerCAmelCase_       :    int								=			self._stacka.append

        if not self._stacka:
          while self._stacka:
            stacka_append(stacka_pop()	)

        if not self._stacka:
          raise IndexError('Queue is empty'	)
        return self._stacka.pop()


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

     testmod()





