


def   UpperCamelCase			(      snake_case__ = 1_00_00_00):
						lowerCAmelCase_	:     List[Any]          = 1
						lowerCAmelCase_	:     List[str]          = 1
						lowerCAmelCase_	:     Union[str, Any]          = {1: 1}

						for inputa in range(2						,  snake_case__):
												lowerCAmelCase_	:     Any          = 0
												lowerCAmelCase_	:     Optional[int]          = 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_	:     Optional[int]          = counter

												if counter > pre_counter:
																		lowerCAmelCase_	:     str          = inputa
																		lowerCAmelCase_	:     List[str]          = counter
						return largest_number


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




import tempfile
import unittest

from transformers import AutoModelForSeqaSeqLM, AutoTokenizer
from transformers.testing_utils import (
    is_torch_available,
    require_optimum,
    require_torch,
    slow,
)


if is_torch_available():
							import torch





@require_torch
@require_optimum
@slow
class     lowerCamelCase      (       unittest.TestCase					):







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







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= '''hf-internal-testing/tiny-random-t5'''
				SCREAMING_SNAKE_CASE     						= AutoTokenizer.from_pretrained(lowercase			)
				SCREAMING_SNAKE_CASE     						= AutoModelForSeqaSeqLM.from_pretrained(lowercase			)

				SCREAMING_SNAKE_CASE     						= tokenizer('''This is me'''   ,     return_tensors='''pt'''			)

				SCREAMING_SNAKE_CASE     						= model.to_bettertransformer()

				self.assertTrue(any('''BetterTransformer''' in mod.__class__.__name__ for _, mod in model.named_modules()			)			)

				SCREAMING_SNAKE_CASE     						= model.generate(**lowercase			)

				SCREAMING_SNAKE_CASE     						= model.reverse_bettertransformer()

				self.assertFalse(any('''BetterTransformer''' in mod.__class__.__name__ for _, mod in model.named_modules()			)			)

				with tempfile.TemporaryDirectory() as tmpdirname:
							model.save_pretrained(lowercase			)

							SCREAMING_SNAKE_CASE     						= AutoModelForSeqaSeqLM.from_pretrained(lowercase			)

							self.assertFalse(
							    any('''BetterTransformer''' in mod.__class__.__name__ for _, mod in model_reloaded.named_modules()			)			)

							SCREAMING_SNAKE_CASE     						= model_reloaded.generate(**lowercase			)
							self.assertTrue(torch.allclose(lowercase   ,     lowercase			)			)







	def  snake_case__     (     self      :Union[str, Any]			)		->      Optional[int]:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= '''hf-internal-testing/tiny-random-t5'''
				SCREAMING_SNAKE_CASE     						= AutoModelForSeqaSeqLM.from_pretrained(lowercase			)

				SCREAMING_SNAKE_CASE     						= model.to_bettertransformer()

				with tempfile.TemporaryDirectory() as tmpdirname:
							with self.assertRaises(lowercase			):
										model.save_pretrained(lowercase			)

							SCREAMING_SNAKE_CASE     						= model.reverse_bettertransformer()
							model.save_pretrained(lowercase			)