#C4400. Roman Numeral Decoder
Roman Numeral Decoder
Roman Numeral Decoder
You are given a string representing a Roman numeral. Your task is to convert this Roman numeral into its corresponding integer value. The Roman numeral will follow the standard rules and will represent a value in the range \(1\) to \(3999\).
The conversion rules are as follows: If a smaller numeral is placed before a larger numeral, it is subtracted from the larger numeral; otherwise, it is added. For example, the numeral MCMXCIV
should be converted to 1994
.
inputFormat
The input consists of a single line containing a non-empty string \(s\) which represents a valid Roman numeral.
outputFormat
Output a single integer, which is the integer conversion of the Roman numeral.
## sampleIII
3