






"""simple docstring"""



from __future__ import annotations

_snake_case       :      List[str]       =					{1: 1}




def 						lowerCamelCase_				(  __A  :		int			):
					if n in COLLATZ_SEQUENCE_LENGTHS:
										return COLLATZ_SEQUENCE_LENGTHS[n]
					lowerCamelCase__				=n // 2 if n % 2 == 0 else 3 * n + 1
					lowerCamelCase__				=collatz_sequence_length(__A			) + 1
					lowerCamelCase__				=sequence_length
					return sequence_length




def 						lowerCamelCase_				(  __A  :		int = 100_0000			):
					lowerCamelCase__				=max((collatz_sequence_length(__A			), i) for i in range(1			,	__A			)			)
					return result[1]


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








"""simple docstring"""



_snake_case       :      Dict       =					[0.485, 0.456, 0.406]
_snake_case       :      int       =					[0.229, 0.224, 0.225]
_snake_case       :      Optional[int]       =					[0.5, 0.5, 0.5]
_snake_case       :      str       =					[0.5, 0.5, 0.5]
_snake_case       :      str       =					[0.4814_5466, 0.457_8275, 0.4082_1073]
_snake_case       :      str       =					[0.2686_2954, 0.2613_0258, 0.2757_7711]