



"""simple docstring"""





def 	__lowerCAmelCase						(		__UpperCamelCase      :			int = 1_0_0_0_0_0_0    ):


						'''simple docstring'''






						snake_case_   : int						=			1
						snake_case_   : Optional[int]						=			1
						snake_case_   : Optional[Any]						=			{1: 1}

						for inputa in range(2					, lowerCAmelCase__    ):
												snake_case_   : Dict						=			0
												snake_case_   : Any						=			inputa

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

												if inputa not in counters:
																		snake_case_   : Optional[int]						=			counter

												if counter > pre_counter:
																		snake_case_   : List[str]						=			inputa
																		snake_case_   : Union[str, Any]						=			counter
						return largest_number


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






"""simple docstring"""





import unittest

from transformers import is_flax_available
from transformers.testing_utils import require_flax, require_sentencepiece, require_tokenizers, require_torch, slow


if is_flax_available():
					import optax
					from flax.training.common_utils import onehot

					from transformers import AutoTokenizer, FlaxMTaForConditionalGeneration
					from transformers.models.ta.modeling_flax_ta import shift_tokens_right



@require_torch
@require_sentencepiece
@require_tokenizers
@require_flax
class    _lowerCAmelCase    (				unittest.TestCase		):





		"""simple docstring"""






		@slow
		def    UpperCAmelCase__							(					self   ) ->						Optional[int]:







								'''simple docstring'''

								snake_case_   : int						=			FlaxMTaForConditionalGeneration.from_pretrained("""google/mt5-small"""   )
								snake_case_   : List[Any]						=			AutoTokenizer.from_pretrained("""google/mt5-small"""   )

								snake_case_   : Dict						=			tokenizer("""Hello there"""							,    return_tensors="""np"""   ).input_ids
								snake_case_   : List[str]						=			tokenizer("""Hi I am"""							,    return_tensors="""np"""   ).input_ids

								snake_case_   : Optional[Any]						=			shift_tokens_right(_lowercase							,    model.config.pad_token_id							,    model.config.decoder_start_token_id   )

								snake_case_   : Tuple						=			model(_lowercase							,    decoder_input_ids=_lowercase   ).logits
								snake_case_   : Tuple						=			optax.softmax_cross_entropy(_lowercase							,    onehot(_lowercase							,    logits.shape[-1]   )   ).mean()

								snake_case_   : List[str]						=			-(labels.shape[-1] * loss.item())

								snake_case_   : Optional[int]						=			-84.9127
								self.assertTrue(abs(mtf_score - EXPECTED_SCORE   ) < 1E-4   )

