


def 			lowerCAmelCase (		lowerCAmelCase_ = 1_000_000 )-> int:
				lowerCAmelCase_ :      Dict    				=				1
				lowerCAmelCase_ :      List[Any]    				=				1
				lowerCAmelCase_ :      Optional[Any]    				=				{1: 1}

				for inputa in range(2 ,   lowerCAmelCase_ ):
								lowerCAmelCase_ :      Tuple    				=				0
								lowerCAmelCase_ :      Dict    				=				inputa

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

								if inputa not in counters:
												lowerCAmelCase_ :      Tuple    				=				counter

								if counter > pre_counter:
												lowerCAmelCase_ :      Optional[int]    				=				inputa
												lowerCAmelCase_ :      Union[str, Any]    				=				counter
				return largest_number


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



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCAmelCase			:  Union[str, Any]     ={
    """configuration_llama""": ["""LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LlamaConfig"""],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Optional[Any]     =["""LlamaTokenizer"""]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Optional[int]     =["""LlamaTokenizerFast"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Tuple     =[
						    """LlamaForCausalLM""",
						    """LlamaModel""",
						    """LlamaPreTrainedModel""",
						    """LlamaForSequenceClassification""",
						]


if TYPE_CHECKING:
						from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_llama import LlamaTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_llama_fast import LlamaTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_llama import LlamaForCausalLM, LlamaForSequenceClassification, LlamaModel, LlamaPreTrainedModel


else:
						import sys

						_UpperCAmelCase			:  List[Any]     =_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)