

from collections import namedtuple

SCREAMING_SNAKE_CASE_						=					namedtuple('from_to', 'from_ to')

SCREAMING_SNAKE_CASE_						=					{
    'millimeter': 'mm',
    'centimeter': 'cm',
    'meter': 'm',
    'kilometer': 'km',
    'inch': 'in',
    'inche': 'in',  # Trailing 's' has been stripped off
    'feet': 'ft',
    'foot': 'ft',
    'yard': 'yd',
    'mile': 'mi',
}

SCREAMING_SNAKE_CASE_						=					{
    'mm': from_to(0.001, 1000),
    'cm': from_to(0.01, 100),
    'm': from_to(1, 1),
    'km': from_to(1000, 0.001),
    'in': from_to(0.0254, 39.3701),
    'ft': from_to(0.3048, 3.2_8084),
    'yd': from_to(0.9144, 1.0_9361),
    'mi': from_to(1609.34, 0.0_0062_1371),
}

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     float     ,					lowerCAmelCase:     str     ,					lowerCAmelCase:     str       )      ->				float:
				_UpperCAmelCase				:						Dict       						=			from_type.lower().rstrip("s"       )
				_UpperCAmelCase				:						List[str]       						=			TYPE_CONVERSION.get(lowerCAmelCase     ,					lowerCAmelCase       )
				_UpperCAmelCase				:						Dict       						=			to_type.lower().rstrip("s"       )
				_UpperCAmelCase				:						Any       						=			TYPE_CONVERSION.get(lowerCAmelCase     ,					lowerCAmelCase       )
				if new_from not in METRIC_CONVERSION:
								_UpperCAmelCase				:						Tuple       						=			(
								    F'Invalid \'from_type\' value: {from_type!r}.\n'
								    F'Conversion abbreviations are: {", ".join(lowerCAmelCase       )}'
								)
								raise ValueError(lowerCAmelCase       )
				if new_to not in METRIC_CONVERSION:
								_UpperCAmelCase				:						Union[str, Any]       						=			(
								    F'Invalid \'to_type\' value: {to_type!r}.\n'
								    F'Conversion abbreviations are: {", ".join(lowerCAmelCase       )}'
								)
								raise ValueError(lowerCAmelCase       )
				return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
					import doctest

					doctest.testmod()





from __future__ import annotations

SCREAMING_SNAKE_CASE_						=					'Alexander Joslin'

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				int:

				if number <= 0:
								_UpperCAmelCase				:						Optional[Any]       						=			F'n must be greater than 0. Got n = {number}'
								raise ValueError(lowerCAmelCase       )

				_UpperCAmelCase				:						Dict       						=			[number + 1] * (number + 1)

				# starting position
				_UpperCAmelCase				:						Dict       						=			0
				for i in range(1     ,					lowerCAmelCase       ):
								_UpperCAmelCase				:						int       						=			min(table[i + 1]     ,					table[i] + 1       )
								# check if out of bounds
								if i * 2 <= number:
												_UpperCAmelCase				:						int       						=			min(table[i * 2]     ,					table[i] + 1       )
								# check if out of bounds
								if i * 3 <= number:
												_UpperCAmelCase				:						int       						=			min(table[i * 3]     ,					table[i] + 1       )
				return table[number]


if __name__ == "__main__":
					import doctest

					doctest.testmod()


