class      __lowercase  :




				'''simple docstring'''


				def __init__(						self  :						int	,				_a  :						Dict							):
								UpperCamelCase__       						=							data
								UpperCamelCase__       						=							42
								UpperCamelCase__       						=							42






def     lowerCamelCase_ (			UpperCamelCase__    :		Node       ):







				'''simple docstring'''







				UpperCamelCase__       						=							0
				UpperCamelCase__       						=							x






def     lowerCamelCase_ (			UpperCamelCase__    :		Node,						UpperCamelCase__    :		Node       ):







				'''simple docstring'''







				UpperCamelCase__						,      UpperCamelCase__       						=							find_set(a__       ), find_set(a__       )
				if x == y:
								return

				elif x.rank > y.rank:
								UpperCamelCase__       						=							x
				else:
								UpperCamelCase__       						=							y
								if x.rank == y.rank:
												y.rank += 1






def     lowerCamelCase_ (			UpperCamelCase__    :		Node       ):







				'''simple docstring'''







				if x != x.parent:
								UpperCamelCase__       						=							find_set(x.parent       )
				return x.parent






def     lowerCamelCase_ (			UpperCamelCase__    :		Node       ):







				'''simple docstring'''







				UpperCamelCase__       						=							({0, 1, 2}, {3, 4, 5})
				for s in sets:
								if node.data in s:
												return s
				UpperCamelCase__       						=							F"""{node.data} is not in {sets}"""
				raise ValueError(a__       )






def     lowerCamelCase_ (			):







				'''simple docstring'''







				UpperCamelCase__       						=							[Node(a__       ) for i in range(6       )]
				for v in vertex:
								make_set(a__       )

				union_set(vertex[0],						vertex[1]       )
				union_set(vertex[1],						vertex[2]       )
				union_set(vertex[3],						vertex[4]       )
				union_set(vertex[3],						vertex[5]       )

				for nodea in vertex:
								for nodea in vertex:
												if find_python_set(a__       ).isdisjoint(find_python_set(a__       )       ):
																assert find_set(a__       ) != find_set(a__       )
												else:
																assert find_set(a__       ) == find_set(a__       )


if __name__ == "__main__":
		test_disjoint_set()









'''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())))




