459. Kartik Bhaiya and Roman Numbers
0
Easy
Click here to learn more about Roman Numerals
Kartik Bhaiya, a mathematics teacher, has assigned Om the task of converting Roman Numerals to integers. However, Om finds this task uninteresting. Can you write a code to assist him?
Kartik Bhaiya, a mathematics teacher, has assigned Om the task of converting Roman Numerals to integers. However, Om finds this task uninteresting. Can you write a code to assist him?
Input Format
The first line of input contains a string s, which represents a valid Roman numeral.
Output Format
Print the integer corresponding to the given Roman numeral.
Example
Input
MCMXCIV
Output
1994
Constraints
1<=|s|<=15
s consists only of the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M').
s consists only of the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M').
Loading...
View Submissions
Console