


'''simple docstring'''


def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE :       Union[str, Any]     		=      0
				while num > 0:
								digit_sum += num % 10
								num //= 10
				return digit_sum







def 			snake_case_   (  SCREAMING_SNAKE_CASE__ = 100     ):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE :       Dict     		=      1
				_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      2

				for i in range(2							,      max_n + 1     ):
								_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      pre_numerator
								_SCREAMING_SNAKE_CASE :       List[str]     		=      2 * i // 3 if i % 3 == 0 else 1
								_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      cur_numerator
								_SCREAMING_SNAKE_CASE :       Optional[int]     		=      e_cont * pre_numerator + temp

				return sum_digits(SCREAMING_SNAKE_CASE__     )


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








'''simple docstring'''


def 			snake_case_   (  SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE :       int     		=      0
				while len(SCREAMING_SNAKE_CASE__     ) > 1:
								_SCREAMING_SNAKE_CASE :       Any     		=      0
								# Consider two files with minimum cost to be merged
								for _ in range(2     ):
												_SCREAMING_SNAKE_CASE :       Optional[int]     		=      files.index(min(SCREAMING_SNAKE_CASE__     )     )
												temp += files[min_index]
												files.pop(SCREAMING_SNAKE_CASE__     )
								files.append(SCREAMING_SNAKE_CASE__     )
								optimal_merge_cost += temp
				return optimal_merge_cost


if __name__ == "__main__":
				import doctest

				doctest.testmod()




