
"""simple docstring"""



import os

a       :						Any       		=		{'''I''': 1, '''V''': 5, '''X''': 1_0, '''L''': 5_0, '''C''': 1_0_0, '''D''': 5_0_0, '''M''': 1_0_0_0}


def 			_UpperCamelCase						(    _A   )     ->	int:





    """simple docstring"""

    _UpperCAmelCase        = 0

    _UpperCAmelCase        = 0
    while index < len(_A   ) - 1:
        _UpperCAmelCase        = SYMBOLS[numerals[index]]
        _UpperCAmelCase        = 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						(    _A   )     ->	str:





    """simple docstring"""

    _UpperCAmelCase        = """"""

    _UpperCAmelCase        = num // 1_0_0_0
    numerals += m_count * "M"
    num %= 1_0_0_0

    _UpperCAmelCase        = 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

    _UpperCAmelCase        = 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 			_UpperCamelCase						(    _A = "/p089_roman.txt"   )     ->	int:





    """simple docstring"""

    _UpperCAmelCase        = 0

    with open(os.path.dirname(_A   ) + roman_numerals_filename   ) as filea:
        _UpperCAmelCase        = filea.readlines()

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

    return savings


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

"""simple docstring"""



def 			_UpperCamelCase						(    _A = 1_0_0_0   )     ->	int:





    """simple docstring"""

    _UpperCAmelCase     ,_UpperCAmelCase        = 1, 1
    _UpperCAmelCase        = 2
    while True:
        _UpperCAmelCase        = 0
        _UpperCAmelCase        = fa + fa
        _UpperCAmelCase     ,_UpperCAmelCase        = fa, f
        index += 1
        for _ in str(_A   ):
            i += 1
        if i == n:
            break
    return index


if __name__ == "__main__":
 print(solution(int(str(input()).strip())))