


import argparse

import torch
from huggingface_hub import hf_hub_download

from transformers import AutoTokenizer, RobertaPreLayerNormConfig, RobertaPreLayerNormForMaskedLM
from transformers.utils import logging


logging.set_verbosity_info()
_UpperCAmelCase			:  Optional[Any]     =logging.get_logger(__name__)



def 			lowerCAmelCase (		lowerCAmelCase_ ,   lowerCAmelCase_ )-> Optional[Any]:
				lowerCAmelCase_ :      Dict    				=				RobertaPreLayerNormConfig.from_pretrained(
				    lowerCAmelCase_ ,   architectures=['''RobertaPreLayerNormForMaskedLM'''] )

				# convert state_dict
				lowerCAmelCase_ :      List[Any]    				=				torch.load(hf_hub_download(repo_id=lowerCAmelCase_ ,   filename='''pytorch_model.bin''' ) )
				lowerCAmelCase_ :      Optional[Any]    				=				{}
				for tensor_key, tensor_value in original_state_dict.items():
								# The transformer implementation gives the model a unique name, rather than overwiriting 'roberta'
								if tensor_key.startswith('''roberta.''' ):
												lowerCAmelCase_ :      Dict    				=				'''roberta_prelayernorm.''' + tensor_key[len('''roberta.''' ) :]

								# The original implementation contains weights which are not used, remove them from the state_dict
								if tensor_key.endswith('''.self.LayerNorm.weight''' ) or tensor_key.endswith('''.self.LayerNorm.bias''' ):
												continue

								lowerCAmelCase_ :      Union[str, Any]    				=				tensor_value

				lowerCAmelCase_ :      int    				=				RobertaPreLayerNormForMaskedLM.from_pretrained(
				    pretrained_model_name_or_path=lowerCAmelCase_ ,   config=lowerCAmelCase_ ,   state_dict=lowerCAmelCase_ )
				model.save_pretrained(lowerCAmelCase_ )

				# convert tokenizer
				lowerCAmelCase_ :      Optional[int]    				=				AutoTokenizer.from_pretrained(lowerCAmelCase_ )
				tokenizer.save_pretrained(lowerCAmelCase_ )


if __name__ == "__main__":
						_UpperCAmelCase			:  Any     =argparse.ArgumentParser()
						# Required parameters
						parser.add_argument(
						    """--checkpoint-repo""",
						    default=None,
						    type=str,
						    required=True,
						    help="""Path the official PyTorch dump, e.g. 'andreasmadsen/efficient_mlm_m0.40'.""",
						)
						parser.add_argument(
						    """--pytorch_dump_folder_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
						)
						_UpperCAmelCase			:  str     =parser.parse_args()
						convert_roberta_prelayernorm_checkpoint_to_pytorch(args.checkpoint_repo, args.pytorch_dump_folder_path)



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