





"""simple docstring"""





def 					__A  (_SCREAMING_SNAKE_CASE = 10**9     )   ->int:





  """simple docstring"""


  lowerCAmelCase__     :Tuple											=				1
  lowerCAmelCase__     :List[str]											=				2

  lowerCAmelCase__     :List[Any]											=				0
  lowerCAmelCase__     :Tuple											=				0
  lowerCAmelCase__     :Any											=				0
  while perimeter <= max_perimeter:
    perimeters_sum += perimeter

    prev_value += 2 * value
    value += prev_value

    lowerCAmelCase__     :Optional[Any]											=				2 * value + 2 if i % 2 == 0 else 2 * value - 2
    i += 1

  return perimeters_sum


if __name__ == "__main__":
  print(F'''{solution() = }''')




"""simple docstring"""






import os





def 				A_       ( )					->  Any:
			with open(os.path.dirname(snake_case__		) + '''/p022_names.txt'''		) as file:
						_UpperCamelCase					:Optional[Any]					     =	str(file.readlines()[0]		)
						_UpperCamelCase					:Dict					     =	names.replace('''"'''       ,					''''''		).split(''','''		)

			names.sort()

			_UpperCamelCase					:str					     =	0
			_UpperCamelCase					:Union[str, Any]					     =	0

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

						total_score += (i + 1) * name_score
						_UpperCamelCase					:List[Any]					     =	0
			return total_score


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

