




from __future__ import annotations

__a  :		Any			=    {1: 1}
def 					snake_case_     (		SCREAMING_SNAKE_CASE_				)			-> int:
							if n in COLLATZ_SEQUENCE_LENGTHS:
														return COLLATZ_SEQUENCE_LENGTHS[n]
							lowercase__  :       Dict   					=							n // 2 if n % 2 == 0 else 3 * n + 1
							lowercase__  :       List[str]   					=							collatz_sequence_length(lowercase_				) + 1
							lowercase__  :       str   					=							sequence_length
							return sequence_length
def 					snake_case_     (		SCREAMING_SNAKE_CASE_ = 1_00_00_00				)			-> int:
							lowercase__  :       str   					=							max((collatz_sequence_length(lowercase_				), i) for i in range(1				,lowercase_				)				)
							return result[1]


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




"""simple docstring"""
from .stack import Stack



def 				lowerCAmelCase_(      lowercase_   :							str							)		->				bool:
				_lowerCamelCase					     = Stack()
				_lowerCamelCase					     = {'''(''': ''')''', '''[''': ''']''', '''{''': '''}'''}
				for bracket in parentheses:
								if bracket in bracket_pairs:
												stack.push(lowercase_							)
								elif bracket in (")", "]", "}"):
												if stack.is_empty() or bracket_pairs[stack.pop()] != bracket:
																return False
				return stack.is_empty()


if __name__ == "__main__":
			from doctest import testmod

			testmod()

			__SCREAMING_SNAKE_CASE     :  Optional[Any]										=					['''((()))''', '''((())''', '''(()))''']
			print('''Balanced parentheses demonstration:\n''')
			for example in examples:
						__SCREAMING_SNAKE_CASE     :  Any										=					'''''' if balanced_parentheses(example) else '''not '''
						print(F"""{example} is {not_str}balanced""")
