#K10841. Roman Numerals to Integer Converter

    ID: 23336 Type: Default 1000ms 256MiB

Roman Numerals to Integer Converter

Roman Numerals to Integer Converter

This problem requires you to convert a given Roman numeral into its corresponding integer value. The Roman numeral is guaranteed to be valid and represents a number in the range \(1\) to \(3999\). The conversion rules follow the traditional Roman numeral system. In particular, when a smaller numeral appears before a larger numeral, it is subtracted from the overall total. For example, \(IV = 4\) (since \(I\) comes before \(V\)) and \(MCMXCIV = 1994\).

inputFormat

The input consists of a single line containing a non-empty string composed of the characters I, V, X, L, C, D, and M that represents a Roman numeral.

outputFormat

Output a single integer which is the conversion result of the provided Roman numeral.

## sample
III
3