The Roman numerals are arranged from left to right in order of decreasing value and added. For example, MMII = 2*1000 + 2*1 = 2002. If a lower numeral appears before a higher one, it is subtracted from the higher value, not added to the total. For example, IX = -1 + 10 = 9. Similarly, XC = -10 + 100 = 90, and XL = -10 + 50 = 40. This avoids writting Roman numerals with more than three consecutive occurrences of the same letter; for example, IV , XL .