




'''simple docstring'''

import os

a       :						int								=		{"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1_000}


def __UpperCAmelCase	(   _UpperCAmelCase		:   List[str]						)      ->      int:
			__snake_case			=		0

			__snake_case			=		0
			while index < len(__lowerCamelCase						) - 1:
						__snake_case			=		SYMBOLS[numerals[index]]
						__snake_case			=		SYMBOLS[numerals[index + 1]]
						if current_value < next_value:
									total_value -= current_value
						else:
									total_value += current_value
						index += 1
			total_value += SYMBOLS[numerals[index]]

			return total_value


def __UpperCAmelCase	(   _UpperCAmelCase		:   Tuple						)      ->      str:
			__snake_case			=		""

			__snake_case			=		num // 10_00
			numerals += m_count * "M"
			num %= 10_00

			__snake_case			=		num // 1_00
			if c_count == 9:
						numerals += "CM"
						c_count -= 9
			elif c_count == 4:
						numerals += "CD"
						c_count -= 4
			if c_count >= 5:
						numerals += "D"
						c_count -= 5
			numerals += c_count * "C"
			num %= 1_00

			__snake_case			=		num // 10
			if x_count == 9:
						numerals += "XC"
						x_count -= 9
			elif x_count == 4:
						numerals += "XL"
						x_count -= 4
			if x_count >= 5:
						numerals += "L"
						x_count -= 5
			numerals += x_count * "X"
			num %= 10

			if num == 9:
						numerals += "IX"
						num -= 9
			elif num == 4:
						numerals += "IV"
						num -= 4
			if num >= 5:
						numerals += "V"
						num -= 5
			numerals += num * "I"

			return numerals


def __UpperCAmelCase	(   _UpperCAmelCase		:   int = "/p089_roman.txt"						)      ->      int:
			__snake_case			=		0

			with open(os.path.dirname(__lowerCamelCase						) + roman_numerals_filename						) as filea:
						__snake_case			=		filea.readlines()

			for line in lines:
						__snake_case			=		line.strip()
						__snake_case			=		parse_roman_numerals(__lowerCamelCase						)
						__snake_case			=		generate_roman_numerals(__lowerCamelCase						)
						savings += len(__lowerCamelCase						) - len(__lowerCamelCase						)

			return savings


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











import os





def 						__A						(      ) ->			Dict:
	with open(os.path.dirname(__lowerCamelCase       ) + """/p022_names.txt"""       ) as file:
		a									=				str(file.readlines()[0]       )
		a									=				names.replace("""\""""				,     """"""       ).split(""","""       )

	names.sort()

	a									=				0
	a									=				0

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

		total_score += (i + 1) * name_score
		a									=				0
	return total_score


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

