






'''simple docstring'''



from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


SCREAMING_SNAKE_CASE							=						logging.get_logger(__name__)


SCREAMING_SNAKE_CASE							=						{
    'Salesforce/codegen-350M-nl': 'https://huggingface.co/Salesforce/codegen-350M-nl/resolve/main/config.json',
    'Salesforce/codegen-350M-multi': 'https://huggingface.co/Salesforce/codegen-350M-multi/resolve/main/config.json',
    'Salesforce/codegen-350M-mono': 'https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/config.json',
    'Salesforce/codegen-2B-nl': 'https://huggingface.co/Salesforce/codegen-2B-nl/resolve/main/config.json',
    'Salesforce/codegen-2B-multi': 'https://huggingface.co/Salesforce/codegen-2B-multi/resolve/main/config.json',
    'Salesforce/codegen-2B-mono': 'https://huggingface.co/Salesforce/codegen-2B-mono/resolve/main/config.json',
    'Salesforce/codegen-6B-nl': 'https://huggingface.co/Salesforce/codegen-6B-nl/resolve/main/config.json',
    'Salesforce/codegen-6B-multi': 'https://huggingface.co/Salesforce/codegen-6B-multi/resolve/main/config.json',
    'Salesforce/codegen-6B-mono': 'https://huggingface.co/Salesforce/codegen-6B-mono/resolve/main/config.json',
    'Salesforce/codegen-16B-nl': 'https://huggingface.co/Salesforce/codegen-16B-nl/resolve/main/config.json',
    'Salesforce/codegen-16B-multi': 'https://huggingface.co/Salesforce/codegen-16B-multi/resolve/main/config.json',
    'Salesforce/codegen-16B-mono': 'https://huggingface.co/Salesforce/codegen-16B-mono/resolve/main/config.json',
}
class UpperCAmelCase_       (     __A					):




      """simple docstring"""




      UpperCamelCase_             =      '''codegen'''
      UpperCamelCase_             =      {
          '''max_position_embeddings''': '''n_positions''',
          '''hidden_size''': '''n_embd''',
          '''num_attention_heads''': '''n_head''',
          '''num_hidden_layers''': '''n_layer''',
      }






      def __init__(			self      :		Any  ,   UpperCAmelCase      :		Dict=5_0400  ,   UpperCAmelCase      :		str=2048  ,   UpperCAmelCase      :		Any=2048  ,   UpperCAmelCase      :		Tuple=4096  ,   UpperCAmelCase      :		List[str]=28  ,   UpperCAmelCase      :		str=16  ,   UpperCAmelCase      :		Optional[Any]=64  ,   UpperCAmelCase      :		str=None  ,   UpperCAmelCase      :		List[str]="gelu_new"  ,   UpperCAmelCase      :		Union[str, Any]=0.0  ,   UpperCAmelCase      :		Optional[int]=0.0  ,   UpperCAmelCase      :		List[Any]=0.0  ,   UpperCAmelCase      :		Optional[int]=1e-5  ,   UpperCAmelCase      :		int=0.0_2  ,   UpperCAmelCase      :		Dict=True  ,   UpperCAmelCase      :		str=5_0256  ,   UpperCAmelCase      :		int=5_0256  ,   UpperCAmelCase      :		Any=False  ,   **UpperCAmelCase      :		List[str]  ,   )	->	List[Any]:


       '''simple docstring'''

       lowercase       : List[Any]						=vocab_size
       lowercase       : int						=n_ctx
       lowercase       : Optional[int]						=n_positions
       lowercase       : int						=n_embd
       lowercase       : str						=n_layer
       lowercase       : Dict						=n_head
       lowercase       : List[str]						=n_inner
       lowercase       : List[Any]						=rotary_dim
       lowercase       : Union[str, Any]						=activation_function
       lowercase       : str						=resid_pdrop
       lowercase       : Optional[int]						=embd_pdrop
       lowercase       : Union[str, Any]						=attn_pdrop
       lowercase       : Dict						=layer_norm_epsilon
       lowercase       : Union[str, Any]						=initializer_range
       lowercase       : List[Any]						=use_cache

       lowercase       : Tuple						=bos_token_id
       lowercase       : str						=eos_token_id

       super().__init__(
           bos_token_id=UpperCAmelCase  ,   eos_token_id=UpperCAmelCase  ,   tie_word_embeddings=UpperCAmelCase  ,   **UpperCAmelCase		)





class UpperCAmelCase_       (     __A					):




      """simple docstring"""




      def __init__(			self      :		List[str]  ,   UpperCAmelCase      :		PretrainedConfig  ,   UpperCAmelCase      :		str = "default"  ,   UpperCAmelCase      :		List[PatchingSpec] = None  ,   UpperCAmelCase      :		bool = False  ,   )	->	List[Any]:


       '''simple docstring'''

       super().__init__(UpperCAmelCase  ,   task=UpperCAmelCase  ,   patching_specs=UpperCAmelCase  ,   use_past=UpperCAmelCase		)
       if not getattr(self._config  ,   '''pad_token_id'''  ,   UpperCAmelCase		):
        # TODO: how to do that better?
        lowercase       : List[Any]						=0






      @property
      def 					A__   (			self      :		int		)	->	Mapping[str, Mapping[int, str]]:


       '''simple docstring'''

       lowercase       : str						=OrderedDict({'''input_ids''': {0: '''batch''', 1: '''sequence'''}}		)
       if self.use_past:
        self.fill_with_past_key_values_(UpperCAmelCase  ,   direction='''inputs'''		)
        lowercase       : Tuple						={0: '''batch''', 1: '''past_sequence + sequence'''}
       else:
        lowercase       : Tuple						={0: '''batch''', 1: '''sequence'''}

       return common_inputs






      @property
      def 					A__   (			self      :		Optional[int]		)	->	int:


       '''simple docstring'''

       return self._config.n_layer






      @property
      def 					A__   (			self      :		Optional[Any]		)	->	int:


       '''simple docstring'''

       return self._config.n_head






      def 					A__   (			self      :		List[str]  ,   UpperCAmelCase      :		PreTrainedTokenizer  ,   UpperCAmelCase      :		int = -1  ,   UpperCAmelCase      :		int = -1  ,   UpperCAmelCase      :		bool = False  ,   UpperCAmelCase      :		Optional[TensorType] = None  ,   )	->	Mapping[str, Any]:


       '''simple docstring'''

       lowercase       : Dict						=super(UpperCAmelCase  ,   self		).generate_dummy_inputs(
           UpperCAmelCase  ,   batch_size=UpperCAmelCase  ,   seq_length=UpperCAmelCase  ,   is_pair=UpperCAmelCase  ,   framework=UpperCAmelCase		)

       # We need to order the input in the way they appears in the forward()
       lowercase       : List[str]						=OrderedDict({'''input_ids''': common_inputs['''input_ids''']}		)

       # Need to add the past_keys
       if self.use_past:
        if not is_torch_available():
         raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''		)
        else:
         import torch

         lowercase	,		lowercase       : Any						=common_inputs['''input_ids'''].shape
         # Not using the same length for past_key_values
         lowercase       : Tuple						=seqlen + 2
         lowercase       : int						=(
             batch,
             self.num_attention_heads,
             past_key_values_length,
             self._config.hidden_size // self.num_attention_heads,
         )
         lowercase       : str						=[
             (torch.zeros(UpperCAmelCase		), torch.zeros(UpperCAmelCase		)) for _ in range(self.num_layers		)
         ]

       lowercase       : List[Any]						=common_inputs['''attention_mask''']
       if self.use_past:
        lowercase       : Any						=ordered_inputs['''attention_mask'''].dtype
        lowercase       : Union[str, Any]						=torch.cat(
            [ordered_inputs['''attention_mask'''], torch.ones(UpperCAmelCase  ,   UpperCAmelCase  ,   dtype=UpperCAmelCase		)]  ,   dim=1		)

       return ordered_inputs






      @property
      def 					A__   (			self      :		Tuple		)	->	int:


       '''simple docstring'''

       return 13









"""simple docstring"""




def        a__					(							snake_case__ = 10_00							)		->   int:
			lowerCamelCase ,  lowerCamelCase      =   1, 1
			lowerCamelCase      =   2
			while True:
						lowerCamelCase      =   0
						lowerCamelCase      =   fa + fa
						lowerCamelCase ,  lowerCamelCase      =   fa, f
						index += 1
						for _ in str(snake_case__							):
									i += 1
						if i == n:
									break
			return index


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



