




from ..utils import DummyObject, requires_backends


class  A		(  metaclass=__UpperCAmelCase     ):
		__snake_case									=   ['speech']



		def __init__(     self,	*UpperCamelCase__,	**UpperCamelCase__   ):







								"""simple docstring"""



								requires_backends(self,	['''speech''']   )







class  A		(  metaclass=__UpperCAmelCase     ):
		__snake_case									=   ['speech']



		def __init__(     self,	*UpperCamelCase__,	**UpperCamelCase__   ):







								"""simple docstring"""



								requires_backends(self,	['''speech''']   )










def __UpperCamelCase			(       _A = 1000000  ):
						lowerCAmelCase_      			=  1
						lowerCAmelCase_      			=  1
						lowerCAmelCase_      			=  {1: 1}

						for inputa in range(2 ,  _A  ):
												lowerCAmelCase_      			=  0
												lowerCAmelCase_      			=  inputa

												while True:
																		if number in counters:
																								counter += counters[number]
																								break
																		if number % 2 == 0:
																								number //= 2
																								counter += 1
																		else:
																								lowerCAmelCase_      			=  (3 * number) + 1
																								counter += 1

												if inputa not in counters:
																		lowerCAmelCase_      			=  counter

												if counter > pre_counter:
																		lowerCAmelCase_      			=  inputa
																		lowerCAmelCase_      			=  counter
						return largest_number


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




