def  _lowerCamelCase					(   a_				: Optional[int] = 1_00_00_00):
			lowerCamelCase						:Tuple						  =     1
			lowerCamelCase						:Any						  =     1
			lowerCamelCase						:Union[str, Any]						  =     {1: 1}

			for inputa in range(2						,			lowerCAmelCase_):
						lowerCamelCase						:List[Any]						  =     0
						lowerCamelCase						:Tuple						  =     inputa

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

						if inputa not in counters:
									lowerCamelCase						:Optional[int]						  =     counter

						if counter > pre_counter:
									lowerCamelCase						:Optional[int]						  =     inputa
									lowerCamelCase						:Any						  =     counter
			return largest_number


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




import os
from math import logaa





def  _lowerCamelCase					(   a_				: str = "base_exp.txt"):
			lowerCamelCase						:float						  =     0
			lowerCamelCase						:Optional[int]						  =     0
			for i, line in enumerate(open(os.path.join(os.path.dirname(a_)						,			a_))):
						lowerCamelCase  ,    lowerCamelCase						:Optional[int]						  =     list(map(a_						,			line.split(''',''')))
						if x * logaa(a_) > largest:
									lowerCamelCase						:List[Any]						  =     x * logaa(a_)
									lowerCamelCase						:Any						  =     i + 1
			return result


if __name__ == "__main__":
			print(solution())



