

from typing import Any


class 					A		:







    """simple docstring"""





    def __init__( self					:			Tuple						)->       Optional[Any]:





        '''simple docstring'''







        A__        =  []
        A__        =  0


    def __str__( self					:			List[str]						)->       Optional[int]:





        '''simple docstring'''







        A__        =  '<' + str(self.stack						)[1:-1] + '>'
        return printed


    def 		snake_case__	( self					:			List[Any],lowercase_					:			Any						)->       int:





        '''simple docstring'''







        self.stack.append(__SCREAMING_SNAKE_CASE						)
        A__        =  self.length + 1


    def 		snake_case__	( self					:			Dict						)->       Tuple:





        '''simple docstring'''







        self.rotate(1						)
        A__        =  self.stack[self.length - 1]
        A__        =  self.stack[:-1]
        self.rotate(self.length - 1						)
        A__        =  self.length - 1
        return dequeued


    def 		snake_case__	( self					:			Any,lowercase_					:			int						)->       str:





        '''simple docstring'''







        for _ in range(__SCREAMING_SNAKE_CASE						):
            A__        =  self.stack[0]
            A__        =  self.stack[1:]
            self.put(__SCREAMING_SNAKE_CASE						)
            A__        =  self.length - 1


    def 		snake_case__	( self					:			Dict						)->       Optional[Any]:





        '''simple docstring'''







        A__        =  self.get()
        self.put(__SCREAMING_SNAKE_CASE						)
        self.rotate(self.length - 1						)
        return front


    def 		snake_case__	( self					:			Optional[Any]						)->       Any:





        '''simple docstring'''







        return self.length






from __future__ import annotations

__snake_case		:Union[str, Any] 						=	{1: 1}





def 	__snake_case      (     _UpperCAmelCase							):
    if n in COLLATZ_SEQUENCE_LENGTHS:
        return COLLATZ_SEQUENCE_LENGTHS[n]
    __a					=							n // 2 if n % 2 == 0 else 3 * n + 1
    __a					=							collatz_sequence_length(_UpperCAmelCase							) + 1
    __a					=							sequence_length
    return sequence_length





def 	__snake_case      (     _UpperCAmelCase = 1000000							):
    __a					=							max((collatz_sequence_length(_UpperCAmelCase							), i) for i in range(1  ,					_UpperCAmelCase							)							)
    return result[1]


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





