





def 							SCREAMING_SNAKE_CASE__						(    __a = 1_00_00_00   ):
	snake_case_		:			Union[str, Any]											=	1
	snake_case_		:			List[str]											=	1
	snake_case_		:			List[str]											=	{1: 1}

	for inputa in range(2   , __a   ):
		snake_case_		:			List[Any]											=	0
		snake_case_		:			List[str]											=	inputa

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

		if inputa not in counters:
			snake_case_		:			Dict											=	counter

		if counter > pre_counter:
			snake_case_		:			List[Any]											=	inputa
			snake_case_		:			Tuple											=	counter
	return largest_number


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








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_SCREAMING_SNAKE_CASE      	=		{"""configuration_swin""": ["""SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SwinConfig""", """SwinOnnxConfig"""]}


try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_SCREAMING_SNAKE_CASE      	=		[
						    """SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """SwinForImageClassification""",
						    """SwinForMaskedImageModeling""",
						    """SwinModel""",
						    """SwinPreTrainedModel""",
						    """SwinBackbone""",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_SCREAMING_SNAKE_CASE      	=		[
						    """TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """TFSwinForImageClassification""",
						    """TFSwinForMaskedImageModeling""",
						    """TFSwinModel""",
						    """TFSwinPreTrainedModel""",
						]

if TYPE_CHECKING:
						from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_swin import (
												    SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
												    SwinBackbone,
												    SwinForImageClassification,
												    SwinForMaskedImageModeling,
												    SwinModel,
												    SwinPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_swin import (
												    TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFSwinForImageClassification,
												    TFSwinForMaskedImageModeling,
												    TFSwinModel,
												    TFSwinPreTrainedModel,
												)

else:
						import sys

						_SCREAMING_SNAKE_CASE      	=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

