




from __future__ import annotations

__UpperCamelCase      : List[Any]					      =   {1: 1}





def 	__A	(			__lowerCamelCase					)   -> List[str]:






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





def 	__A	(			__lowerCamelCase = 100_0000					)   -> Tuple:
 a		       =							max((collatz_sequence_length(UpperCamelCase_					), i) for i in range(1							,    UpperCamelCase_					)					)
 return result[1]


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







import doctest

import projectq
from projectq.ops import H, Measure





def 	__A	(			__lowerCamelCase					)   -> int:
	a		       =							quantum_engine.allocate_qubit()
	H | qubit
	Measure | qubit
	return int(__lowerCamelCase					)


if __name__ == "__main__":
		doctest.testmod()

		# initialises a new quantum backend
		__UpperCamelCase      : List[Any]					      =   projectq.MainEngine()

		# Generate a list of 10 random numbers
		__UpperCamelCase      : Optional[int]					      =   [get_random_number(quantum_engine) for _ in range(10)]

		# Flushes the quantum engine from memory
		quantum_engine.flush()

		print("Random numbers", random_numbers_list)

