






"""simple docstring"""

def _lowerCAmelCase						(	__lowerCamelCase:int ):

						'''simple docstring'''






						if not isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												__magic_name__      =  f'''Input value of [number={number}] must be an integer'''
												raise TypeError(__lowerCamelCase )
						if number < 1:
												raise ValueError("Input must be a positive integer" )
						return number * (2 * number - 1)


if __name__ == "__main__":
			import doctest

			doctest.testmod()











"""simple docstring"""

from __future__ import annotations

lowercase           =							{1: 1}






def _lowerCAmelCase						(	__lowerCamelCase:int ):

						'''simple docstring'''






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






def _lowerCAmelCase						(	__lowerCamelCase:int = 1_0_0_0_0_0_0 ):

						'''simple docstring'''






						__magic_name__      =  max((collatz_sequence_length(__lowerCamelCase ), i) for i in range(1			,    __lowerCamelCase ) )
						return result[1]


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



