





__lowerCAmelCase     =			{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 24,
    "5": 120,
    "6": 720,
    "7": 5_040,
    "8": 40_320,
    "9": 362_880,
}

__lowerCAmelCase     =			{145: 145}

__lowerCAmelCase     =			{
    145: 0,
    169: 3,
    36_301: 3,
    1_454: 3,
    871: 2,
    45_361: 2,
    872: 2,
}

def     a						(      _lowercase   :     int       )     ->int:
		if n in CACHE_SUM_DIGIT_FACTORIALS:
				return CACHE_SUM_DIGIT_FACTORIALS[n]
		UpperCamelCase__         =	sum(DIGIT_FACTORIALS[let] for let in str(_lowercase       )       )
		UpperCamelCase__         =	ret
		return ret

def     a						(      _lowercase   :     int ,						_lowercase   :     set | None = None       )     ->int:
		UpperCamelCase__         =	previous or set()
		if n in CHAIN_LENGTH_CACHE:
				return CHAIN_LENGTH_CACHE[n]
		UpperCamelCase__         =	sum_digit_factorials(_lowercase       )
		if next_number in previous:
				UpperCamelCase__         =	0
				return 0
		else:
				previous.add(_lowercase       )
				UpperCamelCase__         =	1 + chain_length(_lowercase ,						_lowercase       )
				UpperCamelCase__         =	ret
				return ret

def     a						(      _lowercase   :     int = 6_0 ,						_lowercase   :     int = 1_0_0_0_0_0_0       )     ->int:
		return sum(1 for i in range(1 ,						_lowercase       ) if chain_length(_lowercase       ) == num_terms       )


if __name__ == "__main__":
				print(f"""{solution() = }""")












def     a						(      _lowercase   :     List[str]       )     ->List[str]:
		UpperCamelCase__         =	[7_0_1, 3_0_1, 1_3_2, 5_7, 2_3, 1_0, 4, 1]
		for gap in gaps:
				for i in range(_lowercase ,						len(_lowercase       )       ):
						UpperCamelCase__         =	collection[i]
						UpperCamelCase__         =	i
						while j >= gap and collection[j - gap] > insert_value:
								UpperCamelCase__         =	collection[j - gap]
								j -= gap
						if j != i:
								UpperCamelCase__         =	insert_value
		return collection


if __name__ == "__main__":
				from doctest import testmod

				testmod()
				__lowerCAmelCase     =			input("Enter numbers separated by a comma:\n").strip()
				__lowerCAmelCase     =			[int(item) for item in user_input.split(",")]
				print(shell_sort(unsorted))





