


'''simple docstring'''







from typing import List, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE_      =			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_      =			{
    'huggingface/time-series-transformer-tourism-monthly': (
        'https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json'
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}


class  lowerCAmelCase_						(       snake_case__      ):





  """simple docstring"""



  a_       :Dict												="""time_series_transformer"""
  a_       :Union[str, Any]												={
      """hidden_size""": """d_model""",
      """num_attention_heads""": """encoder_attention_heads""",
      """num_hidden_layers""": """encoder_layers""",
  }

  def __init__(					self     :							List[Any]				,							SCREAMING_SNAKE_CASE__     :							Optional[int] = None				,							SCREAMING_SNAKE_CASE__     :							Optional[int] = None				,							SCREAMING_SNAKE_CASE__     :							str = "student_t"				,							SCREAMING_SNAKE_CASE__     :							str = "nll"				,							SCREAMING_SNAKE_CASE__     :							int = 1				,							SCREAMING_SNAKE_CASE__     :							List[int] = [1, 2, 3, 4, 5, 6, 7]				,							SCREAMING_SNAKE_CASE__     :							Optional[Union[str, bool]] = "mean"				,							SCREAMING_SNAKE_CASE__     :							int = 0				,							SCREAMING_SNAKE_CASE__     :							int = 0				,							SCREAMING_SNAKE_CASE__     :							int = 0				,							SCREAMING_SNAKE_CASE__     :							int = 0				,							SCREAMING_SNAKE_CASE__     :							Optional[List[int]] = None				,							SCREAMING_SNAKE_CASE__     :							Optional[List[int]] = None				,							SCREAMING_SNAKE_CASE__     :							int = 3_2				,							SCREAMING_SNAKE_CASE__     :							int = 3_2				,							SCREAMING_SNAKE_CASE__     :							int = 2				,							SCREAMING_SNAKE_CASE__     :							int = 2				,							SCREAMING_SNAKE_CASE__     :							int = 2				,							SCREAMING_SNAKE_CASE__     :							int = 2				,							SCREAMING_SNAKE_CASE__     :							bool = True				,							SCREAMING_SNAKE_CASE__     :							str = "gelu"				,							SCREAMING_SNAKE_CASE__     :							int = 6_4				,							SCREAMING_SNAKE_CASE__     :							float = 0.1				,							SCREAMING_SNAKE_CASE__     :							float = 0.1				,							SCREAMING_SNAKE_CASE__     :							float = 0.1				,							SCREAMING_SNAKE_CASE__     :							float = 0.1				,							SCREAMING_SNAKE_CASE__     :							float = 0.1				,							SCREAMING_SNAKE_CASE__     :							int = 1_0_0				,							SCREAMING_SNAKE_CASE__     :							float = 0.0_2				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=True				,							**SCREAMING_SNAKE_CASE__     :							Union[str, Any]				,							):





       '''simple docstring'''

       __a       =   prediction_length
       __a       =   context_length or prediction_length
       __a       =   distribution_output
       __a       =   loss
       __a       =   input_size
       __a       =   num_time_features
       __a       =   lags_sequence
       __a       =   scaling
       __a       =   num_dynamic_real_features
       __a       =   num_static_real_features
       __a       =   num_static_categorical_features
       if cardinality and num_static_categorical_features > 0:
            if len(SCREAMING_SNAKE_CASE__						) != num_static_categorical_features:
                 raise ValueError(
                     """The cardinality should be a list of the same length as `num_static_categorical_features`"""						)
            __a       =   cardinality
       else:
            __a       =   [0]
       if embedding_dimension and num_static_categorical_features > 0:
            if len(SCREAMING_SNAKE_CASE__						) != num_static_categorical_features:
                 raise ValueError(
                     """The embedding dimension should be a list of the same length as `num_static_categorical_features`"""						)
            __a       =   embedding_dimension
       else:
            __a       =   [min(5_0				,							(cat + 1) // 2						) for cat in self.cardinality]
       __a       =   num_parallel_samples

       # Transformer architecture configuration
       __a       =   input_size * len(SCREAMING_SNAKE_CASE__						) + self._number_of_features
       __a       =   d_model
       __a       =   encoder_attention_heads
       __a       =   decoder_attention_heads
       __a       =   encoder_ffn_dim
       __a       =   decoder_ffn_dim
       __a       =   encoder_layers
       __a       =   decoder_layers

       __a       =   dropout
       __a       =   attention_dropout
       __a       =   activation_dropout
       __a       =   encoder_layerdrop
       __a       =   decoder_layerdrop

       __a       =   activation_function
       __a       =   init_std

       __a       =   use_cache

       super().__init__(is_encoder_decoder=SCREAMING_SNAKE_CASE__				,							**SCREAMING_SNAKE_CASE__						)


  @property
  def __a						(					self     :							Dict						):





       '''simple docstring'''

       return (
           sum(self.embedding_dimension						)
           + self.num_dynamic_real_features
           + self.num_time_features
           + self.num_static_real_features
           + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
       )










'''simple docstring'''







def        __lowercase						(      __SCREAMING_SNAKE_CASE = 100_0000		)				->					int:
     """simple docstring"""




     __a       =   1
     __a       =   1
     __a       =   {1: 1}

     for inputa in range(2				,  __SCREAMING_SNAKE_CASE		):
          __a       =   0
          __a       =   inputa

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

          if inputa not in counters:
               __a       =   counter

          if counter > pre_counter:
               __a       =   inputa
               __a       =   counter
     return largest_number


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






