


"""simple docstring"""







import os

lowerCAmelCase__      				=   {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1_000}
def 					a__			(				SCREAMING_SNAKE_CASE    :    int				):


  '''simple docstring'''







  lowerCAmelCase     :     Optional[Any]								=							0

  lowerCAmelCase     :     str								=							0
  while index < len(__A				) - 1:
    lowerCAmelCase     :     Any								=							SYMBOLS[numerals[index]]
    lowerCAmelCase     :     Tuple								=							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 					a__			(				SCREAMING_SNAKE_CASE    :    Union[str, Any]				):


  '''simple docstring'''







  lowerCAmelCase     :     str								=							""

  lowerCAmelCase     :     str								=							num // 1_0_0_0
  numerals += m_count * "M"
  num %= 1_0_0_0

  lowerCAmelCase     :     Union[str, Any]								=							num // 1_0_0
  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_0_0

  lowerCAmelCase     :     str								=							num // 1_0
  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 %= 1_0

  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 					a__			(				SCREAMING_SNAKE_CASE    :    Tuple = "/p089_roman.txt"				):


  '''simple docstring'''







  lowerCAmelCase     :     Optional[Any]								=							0

  with open(os.path.dirname(__A				) + roman_numerals_filename				) as filea:
    lowerCAmelCase     :     Any								=							filea.readlines()

  for line in lines:
    lowerCAmelCase     :     Optional[int]								=							line.strip()
    lowerCAmelCase     :     Tuple								=							parse_roman_numerals(__A				)
    lowerCAmelCase     :     Any								=							generate_roman_numerals(__A				)
    savings += len(__A				) - len(__A				)

  return savings


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







'''simple docstring'''







def 				SCREAMING_SNAKE_CASE__	(   __A	)       ->	str:
	_snake_case   						=		1
	_snake_case   						=		2
	while i * i <= n:
		_snake_case   						=		0
		while n % i == 0:
			n //= i
			multiplicity += 1
		n_divisors *= multiplicity + 1
		i += 1
	if n > 1:
		n_divisors *= 2
	return n_divisors







def 				SCREAMING_SNAKE_CASE__	(   )       ->	List[str]:
	_snake_case   						=		1
	_snake_case   						=		1

	while True:
		i += 1
		t_num += i

		if count_divisors(__A	) > 500:
			break

	return t_num


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

