




def  lowerCAmelCase  (	UpperCAmelCase       )  ->Optional[int]:






					"""simple docstring"""






					__magic_name__					:							Tuple		   =							len(a__       )

					# Set the gap value to be decreased by a factor of 1.3
					# after each iteration
					__magic_name__					:							Optional[Any]		   =							1.3

					# Continue sorting until the gap is 1
					while gap > 1:
										# Decrease the gap value
										__magic_name__					:							Optional[Any]		   =							int(gap / shrink       )

										# Sort the elements using insertion sort
										for i in range(a__,	len(a__       )       ):
															__magic_name__					:							str		   =							collection[i]
															__magic_name__					:							Dict		   =							i
															while j >= gap and collection[j - gap] > temp:
																				__magic_name__					:							Any		   =							collection[j - gap]
																				j -= gap
															__magic_name__					:							List[Any]		   =							temp

					return collection


if __name__ == "__main__":
				import doctest

				doctest.testmod()









'''simple docstring'''
from __future__ import annotations

A							:      List[str] 	=       {1: 1}
def 				snake_case_  (   a__		:	int			):



    """simple docstring"""




    if n in COLLATZ_SEQUENCE_LENGTHS:
        return COLLATZ_SEQUENCE_LENGTHS[n]
    __lowercase							=						n // 2 if n % 2 == 0 else 3 * n + 1
    __lowercase							=						collatz_sequence_length(a__			) + 1
    __lowercase							=						sequence_length
    return sequence_length
def 				snake_case_  (   a__		:	int = 1_00_00_00			):



    """simple docstring"""




    __lowercase							=						max((collatz_sequence_length(a__			), i) for i in range(1    ,a__			)			)
    return result[1]


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




