def from_roman(roman_string):
	""" Converts roman number to integer. """
	NUMBERS = {
				'I' : 1,
				'V' : 5,
				'X' : 10,
				'L' : 50,
				'C' : 100,
				'D' : 500,
				'M' : 1000,
				}
	result = 0
	prev_value = 0
	for c in roman_string.upper():
		value = NUMBERS[c]
		if prev_value > 0 and prev_value < value:
			result -= prev_value * 2
		result += value
		prev_value = value
	return result