Convert arbitrary roman numeral input to integer output The usual rules: no external resources, or the like.  Input will be a positive integer in valid Roman numeral format less than 10 thousand, say.

Use all the Roman numeral characters:


I =  1
V =  5
X =  10
L =  50
C =  100
D =  500
M =  1,000


Respect subtractive notation (copied from the Wikipedia page):


the numeral I can be placed before V and X to make 4 units (IV) and 9 units (IX) respectively
X can be placed before L and C to make 40 (XL) and 90 (XC) respectively
C can be placed before D and M to make 400 (CD) and 900 (CM) according to the same pattern[5]
Mathematica, 33 chars
FromDigits[InputString[],&quot;Roman&quot;]