Convert a valid Roman numeral to its integer value. The symbols are I=1, V=5, X=10, L=50, C=100, D=500, M=1000. A smaller symbol placed immediately before a larger one is subtracted (for example IV=4, IX=9, XL=40); otherwise symbol values are added left to right.
Input format
One line: a valid Roman numeral for an integer between 1 and 3999 (uppercase letters).
Output format
One line: the integer value.
Constraints
- The input is always a well-formed Roman numeral in the range 1..3999.