



'''simple docstring'''



from __future__ import annotations

lowerCAmelCase						:		str						      = {1: 1}



def 	__lowerCAmelCase       (				lowerCamelCase :    int       ):






	'''simple docstring'''




	if n in COLLATZ_SEQUENCE_LENGTHS:
		return COLLATZ_SEQUENCE_LENGTHS[n]
	__lowerCAmelCase       				=	n // 2 if n % 2 == 0 else 3 * n + 1
	__lowerCAmelCase       				=	collatz_sequence_length(lowerCamelCase       ) + 1
	__lowerCAmelCase       				=	sequence_length
	return sequence_length



def 	__lowerCAmelCase       (				lowerCamelCase :    int = 1_00_00_00       ):






	'''simple docstring'''




	__lowerCAmelCase       				=	max((collatz_sequence_length(lowerCamelCase       ), i) for i in range(1					,		lowerCamelCase       )       )
	return result[1]


if __name__ == "__main__":
	print(solution(int(input().strip())))




'''simple docstring'''



lowerCAmelCase						:		Tuple						      = '''
# Diffusers installation
! pip install diffusers transformers datasets accelerate
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/diffusers.git
'''

lowerCAmelCase						:		Tuple						      = [{'''type''': '''code''', '''content''': INSTALL_CONTENT}]