

"""simple docstring"""
import os




def 					a__						(						)	-> str:
      with open(os.path.dirname(lowerCAmelCase    ) + """/p022_names.txt"""    ) as file:
            UpperCAmelCase__			:							List[str]							=    str(file.readlines()[0]    )
            UpperCAmelCase__			:							Any							=    names.replace("""\""""			,	""""""    ).split(""","""    )

      names.sort()

      UpperCAmelCase__			:							Optional[int]							=    0
      UpperCAmelCase__			:							Union[str, Any]							=    0

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

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


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




"""simple docstring"""
def 					a__						(						)	-> Union[str, Any]:
      UpperCAmelCase__			:							Dict							=    []
      UpperCAmelCase__			:							Tuple							=    1

      while len(lowerCAmelCase    ) < 1E6:
            constant.append(str(lowerCAmelCase    )    )
            i += 1

      UpperCAmelCase__			:							Any							=    """""".join(lowerCAmelCase    )

      return (
          int(constant[0]    )
          * int(constant[9]    )
          * int(constant[99]    )
          * int(constant[9_99]    )
          * int(constant[99_99]    )
          * int(constant[9_99_99]    )
          * int(constant[99_99_99]    )
      )


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

