


import unittest

import numpy as np

from transformers import RobertaConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask


if is_flax_available():
						from transformers.models.roberta.modeling_flax_roberta import (
						    FlaxRobertaForCausalLM,
						    FlaxRobertaForMaskedLM,
						    FlaxRobertaForMultipleChoice,
						    FlaxRobertaForQuestionAnswering,
						    FlaxRobertaForSequenceClassification,
						    FlaxRobertaForTokenClassification,
						    FlaxRobertaModel,
						)






class 				snake_case__(							unittest.TestCase							):







						'''simple docstring'''




						def __init__(				self   ,						__lowercase   ,						__lowercase=1_3   ,						__lowercase=7   ,						__lowercase=True   ,						__lowercase=True   ,						__lowercase=True   ,						__lowercase=True   ,						__lowercase=9_9   ,						__lowercase=3_2   ,						__lowercase=5   ,						__lowercase=4   ,						__lowercase=3_7   ,						__lowercase="gelu"   ,						__lowercase=0.1   ,						__lowercase=0.1   ,						__lowercase=5_1_2   ,						__lowercase=1_6   ,						__lowercase=2   ,						__lowercase=0.02   ,						__lowercase=4   ,						)					->    Union[str, Any]:
										lowerCAmelCase_ :      List[str]    				=				parent
										lowerCAmelCase_ :      Any    				=				batch_size
										lowerCAmelCase_ :      List[str]    				=				seq_length
										lowerCAmelCase_ :      Tuple    				=				is_training
										lowerCAmelCase_ :      str    				=				use_attention_mask
										lowerCAmelCase_ :      Tuple    				=				use_token_type_ids
										lowerCAmelCase_ :      str    				=				use_labels
										lowerCAmelCase_ :      List[Any]    				=				vocab_size
										lowerCAmelCase_ :      List[Any]    				=				hidden_size
										lowerCAmelCase_ :      List[Any]    				=				num_hidden_layers
										lowerCAmelCase_ :      Optional[int]    				=				num_attention_heads
										lowerCAmelCase_ :      Union[str, Any]    				=				intermediate_size
										lowerCAmelCase_ :      str    				=				hidden_act
										lowerCAmelCase_ :      Dict    				=				hidden_dropout_prob
										lowerCAmelCase_ :      Dict    				=				attention_probs_dropout_prob
										lowerCAmelCase_ :      List[str]    				=				max_position_embeddings
										lowerCAmelCase_ :      Dict    				=				type_vocab_size
										lowerCAmelCase_ :      Optional[Any]    				=				type_sequence_label_size
										lowerCAmelCase_ :      List[str]    				=				initializer_range
										lowerCAmelCase_ :      Tuple    				=				num_choices




						def 						lowercase_ (				self							)					->    Optional[int]:
										lowerCAmelCase_ :      Any    				=				ids_tensor([self.batch_size, self.seq_length]   ,						self.vocab_size							)

										lowerCAmelCase_ :      List[str]    				=				None
										if self.use_attention_mask:
														lowerCAmelCase_ :      Any    				=				random_attention_mask([self.batch_size, self.seq_length]							)

										lowerCAmelCase_ :      Dict    				=				None
										if self.use_token_type_ids:
														lowerCAmelCase_ :      List[Any]    				=				ids_tensor([self.batch_size, self.seq_length]   ,						self.type_vocab_size							)

										lowerCAmelCase_ :      Optional[int]    				=				RobertaConfig(
										    vocab_size=self.vocab_size   ,						hidden_size=self.hidden_size   ,						num_hidden_layers=self.num_hidden_layers   ,						num_attention_heads=self.num_attention_heads   ,						intermediate_size=self.intermediate_size   ,						hidden_act=self.hidden_act   ,						hidden_dropout_prob=self.hidden_dropout_prob   ,						attention_probs_dropout_prob=self.attention_probs_dropout_prob   ,						max_position_embeddings=self.max_position_embeddings   ,						type_vocab_size=self.type_vocab_size   ,						is_decoder=__lowerCAmelCase   ,						initializer_range=self.initializer_range   ,						)

										return config, input_ids, token_type_ids, attention_mask




						def 						lowercase_ (				self							)					->    Optional[int]:
										lowerCAmelCase_ :      Dict    				=				self.prepare_config_and_inputs()
										lowerCAmelCase_				,  lowerCAmelCase_				,  lowerCAmelCase_				,  lowerCAmelCase_ :      Dict    				=				config_and_inputs
										lowerCAmelCase_ :      Optional[Any]    				=				{'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': attention_mask}
										return config, inputs_dict




						def 						lowercase_ (				self							)					->    Union[str, Any]:
										lowerCAmelCase_ :      List[str]    				=				self.prepare_config_and_inputs()
										lowerCAmelCase_				,  lowerCAmelCase_				,  lowerCAmelCase_				,  lowerCAmelCase_ :      List[str]    				=				config_and_inputs

										lowerCAmelCase_ :      Optional[int]    				=				True
										lowerCAmelCase_ :      Optional[int]    				=				floats_tensor([self.batch_size, self.seq_length, self.hidden_size]							)
										lowerCAmelCase_ :      Dict    				=				ids_tensor([self.batch_size, self.seq_length]   ,						vocab_size=2							)

										return (
										    config,
										    input_ids,
										    token_type_ids,
										    encoder_hidden_states,
										    encoder_attention_mask,
										)






@require_flax
class 				snake_case__(							UpperCAmelCase__,						unittest.TestCase							):







						'''simple docstring'''




						SCREAMING_SNAKE_CASE__      :  Dict					=							True

						SCREAMING_SNAKE_CASE__      :  Tuple					=							(
						    (
						        FlaxRobertaModel,
						        FlaxRobertaForCausalLM,
						        FlaxRobertaForMaskedLM,
						        FlaxRobertaForSequenceClassification,
						        FlaxRobertaForTokenClassification,
						        FlaxRobertaForMultipleChoice,
						        FlaxRobertaForQuestionAnswering,
						    )
						    if is_flax_available()
						    else ()
						)




						def 						lowercase_ (				self							)					->    str:
										lowerCAmelCase_ :      str    				=				FlaxRobertaModelTester(self							)




						@slow
						def 						lowercase_ (				self							)					->    Any:






										for model_class_name in self.all_model_classes:
														lowerCAmelCase_ :      str    				=				model_class_name.from_pretrained('''roberta-base'''   ,						from_pt=__lowerCAmelCase							)
														lowerCAmelCase_ :      str    				=				model(np.ones((1, 1)							)							)
														self.assertIsNotNone(__lowerCAmelCase							)



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