Roman numerals are an odd system:
Base symbols with their numeric meanings, encountered individually:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
Now, if a smaller value is on the right of a larger value, they add; so
VI = 6
XI = 11
LI = 51
CI = 101
DI = 501
MI = 1001
If an I, X, or C value is to the left of a larger value (which also must not pass the next X, C, or M value up), the smaller value is subtracted from the larger value; thus:
IV = 4
IX = 9
XL = 40
XC = 90
CD = 400
CM = 900
If there are two or threee the same symbol (selected from I, X, C, M only) in a row, they add:
II = 2
XX = 20
CC = 200
MM = 2000
III = 3
XXX = 30
CCC = 300
MMM = 3000
These are cumulative; 1999 would be written as MCMXCIX: 1000 + (1000 - 100) + (100 - 10) + (10 - 1) while 2005 would be written as MMV: 1000 + 1000 + 5
For numbers over 4000, there's a an extra notation - a bar over the top multiplies whatever is underneath it by 1000.
One page on the subject - there's more, if you search