





from __future__ import annotations




def  __UpperCAmelCase(   lowercase_			,     lowercase_ = None			,     lowercase_ = None   ):
       if start is None:
              _lowerCamelCase				:  Union[str, Any]						=		0

       if end is None:
              _lowerCamelCase				:  Union[str, Any]						=		len(lowercase_   ) - 1

       if start >= end:
              return

       _lowerCamelCase				:  List[str]						=		(start + end) // 2

       slowsort(lowercase_			,     lowercase_			,     lowercase_   )
       slowsort(lowercase_			,     mid + 1			,     lowercase_   )

       if sequence[end] < sequence[mid]:
              _lowerCamelCase,	_lowerCamelCase				:  str						=		sequence[mid], sequence[end]

       slowsort(lowercase_			,     lowercase_			,     end - 1   )


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

       testmod()








import os




def  __UpperCAmelCase(   ):
       with open(os.path.dirname(lowercase_   ) + '''/p022_names.txt'''   ) as file:
              _lowerCamelCase				:  Optional[int]						=		str(file.readlines()[0]   )
              _lowerCamelCase				:  List[Any]						=		names.replace('''"'''			,     ''''''   ).split(''','''   )

       names.sort()

       _lowerCamelCase				:  Optional[int]						=		0
       _lowerCamelCase				:  Tuple						=		0

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

              total_score += (i + 1) * name_score
              _lowerCamelCase				:  Optional[int]						=		0
       return total_score


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

