

'''simple docstring'''

import os
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


UpperCAmelCase					 =	logging.get_logger(__name__)

UpperCAmelCase					 =	{'''vocab_file''': '''sentencepiece.bpe.model'''}

UpperCAmelCase					 =	{
    '''vocab_file''': {
        '''camembert-base''': '''https://huggingface.co/camembert-base/resolve/main/sentencepiece.bpe.model''',
    }
}

UpperCAmelCase					 =	{
    '''camembert-base''': 512,
}

UpperCAmelCase					 =	'''▁'''


class 	lowerCAmelCase  (   A ):
       lowerCAmelCase_												=			VOCAB_FILES_NAMES
       lowerCAmelCase_												=			PRETRAINED_VOCAB_FILES_MAP
       lowerCAmelCase_												=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       lowerCAmelCase_												=			["input_ids", "attention_mask"]







       def __init__(				self      :			int    ,   __lowercase      :			Any    ,   __lowercase      :			Any="<s>"    ,   __lowercase      :			Dict="</s>"    ,   __lowercase      :			str="</s>"    ,   __lowercase      :			Optional[Any]="<s>"    ,   __lowercase      :			List[Any]="<unk>"    ,   __lowercase      :			Dict="<pad>"    ,   __lowercase      :			Optional[int]="<mask>"    ,   __lowercase      :			Optional[Any]=["<s>NOTUSED", "</s>NOTUSED"]    ,   __lowercase      :			Optional[Dict[str, Any]] = None    ,   **__lowercase      :			List[str]    ,   ):







            """simple docstring"""







            __lowercase      		=AddedToken(__lowercase    ,   lstrip=__lowercase    ,   rstrip=__lowercase   ) if isinstance(__lowercase    ,   __lowercase   ) else mask_token

            __lowercase      		={} if sp_model_kwargs is None else sp_model_kwargs

            super().__init__(
                bos_token=__lowercase    ,   eos_token=__lowercase    ,   unk_token=__lowercase    ,   sep_token=__lowercase    ,   cls_token=__lowercase    ,   pad_token=__lowercase    ,   mask_token=__lowercase    ,   additional_special_tokens=__lowercase    ,   sp_model_kwargs=self.sp_model_kwargs    ,   **__lowercase    ,   )
            __lowercase      		=spm.SentencePieceProcessor(**self.sp_model_kwargs   )
            self.sp_model.Load(str(__lowercase   )   )
            __lowercase      		=vocab_file
            # HACK: These tokens were added by fairseq but don't seem to be actually used when duplicated in the actual
            # sentencepiece vocabulary (this is the case for <s> and </s>
            __lowercase      		={'<s>NOTUSED': 0, '<pad>': 1, '</s>NOTUSED': 2, '<unk>': 3}
            __lowercase      		=len(self.fairseq_tokens_to_ids   )
            __lowercase      		=len(self.sp_model   ) + len(self.fairseq_tokens_to_ids   )
            __lowercase      		={v: k for k, v in self.fairseq_tokens_to_ids.items()}







       def       snake_case (				self      :			Dict    ,   __lowercase      :			List[int]    ,   __lowercase      :			Optional[List[int]] = None   ):







            """simple docstring"""







            if token_ids_a is None:
                 return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
            __lowercase      		=[self.cls_token_id]
            __lowercase      		=[self.sep_token_id]
            return cls + token_ids_a + sep + sep + token_ids_a + sep







       def       snake_case (				self      :			List[Any]    ,   __lowercase      :			List[int]    ,   __lowercase      :			Optional[List[int]] = None    ,   __lowercase      :			bool = False   ):







            """simple docstring"""







            if already_has_special_tokens:
                 return super().get_special_tokens_mask(
                     token_ids_a=__lowercase    ,   token_ids_a=__lowercase    ,   already_has_special_tokens=__lowercase   )

            if token_ids_a is None:
                 return [1] + ([0] * len(__lowercase   )) + [1]
            return [1] + ([0] * len(__lowercase   )) + [1, 1] + ([0] * len(__lowercase   )) + [1]







       def       snake_case (				self      :			Any    ,   __lowercase      :			List[int]    ,   __lowercase      :			Optional[List[int]] = None   ):







            """simple docstring"""







            __lowercase      		=[self.sep_token_id]
            __lowercase      		=[self.cls_token_id]

            if token_ids_a is None:
                 return len(cls + token_ids_a + sep   ) * [0]
            return len(cls + token_ids_a + sep + sep + token_ids_a + sep   ) * [0]







       @property
       def       snake_case (				self      :			Optional[Any]   ):







            """simple docstring"""







            return len(self.fairseq_tokens_to_ids   ) + len(self.sp_model   )







       def       snake_case (				self      :			Dict   ):







            """simple docstring"""







            __lowercase      		={self.convert_ids_to_tokens(__lowercase   ): i for i in range(self.vocab_size   )}
            vocab.update(self.added_tokens_encoder   )
            return vocab







       def       snake_case (				self      :			Any    ,   __lowercase      :			str   ):







            """simple docstring"""







            return self.sp_model.encode(__lowercase    ,   out_type=__lowercase   )







       def       snake_case (				self      :			Tuple    ,   __lowercase      :			Union[str, Any]   ):







            """simple docstring"""







            if token in self.fairseq_tokens_to_ids:
                 return self.fairseq_tokens_to_ids[token]
            elif self.sp_model.PieceToId(__lowercase   ) == 0:
                 # Convert sentence piece unk token to fairseq unk token index
                 return self.unk_token_id
            return self.fairseq_offset + self.sp_model.PieceToId(__lowercase   )







       def       snake_case (				self      :			List[str]    ,   __lowercase      :			Any   ):







            """simple docstring"""







            if index in self.fairseq_ids_to_tokens:
                 return self.fairseq_ids_to_tokens[index]
            return self.sp_model.IdToPiece(index - self.fairseq_offset   )







       def       snake_case (				self      :			Any    ,   __lowercase      :			Union[str, Any]   ):







            """simple docstring"""







            __lowercase      		=[]
            __lowercase      		=''
            __lowercase      		=False
            for token in tokens:
                 # make sure that special tokens are not decoded using sentencepiece model
                 if token in self.all_special_tokens:
                      if not prev_is_special:
                           out_string += " "
                      out_string += self.sp_model.decode(__lowercase   ) + token
                      __lowercase      		=True
                      __lowercase      		=[]
                 else:
                      current_sub_tokens.append(__lowercase   )
                      __lowercase      		=False
            out_string += self.sp_model.decode(__lowercase   )
            return out_string.strip()







       def __getstate__(				self      :			Union[str, Any]   ):







            """simple docstring"""







            __lowercase      		=self.__dict__.copy()
            __lowercase      		=None
            return state







       def __setstate__(				self      :			int    ,   __lowercase      :			Tuple   ):







            """simple docstring"""







            __lowercase      		=d

            # for backward compatibility
            if not hasattr(self    ,   'sp_model_kwargs'   ):
                 __lowercase      		={}

            __lowercase      		=spm.SentencePieceProcessor(**self.sp_model_kwargs   )
            self.sp_model.Load(self.vocab_file   )







       def       snake_case (				self      :			Optional[int]    ,   __lowercase      :			str    ,   __lowercase      :			Optional[str] = None   ):







            """simple docstring"""







            if not os.path.isdir(__lowercase   ):
                 logger.error(f'''Vocabulary path ({save_directory}) should be a directory'''   )
                 return
            __lowercase      		=os.path.join(
                __lowercase    ,   (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']   )

            if os.path.abspath(self.vocab_file   ) != os.path.abspath(__lowercase   ) and os.path.isfile(self.vocab_file   ):
                 copyfile(self.vocab_file    ,   __lowercase   )
            elif not os.path.isfile(self.vocab_file   ):
                 with open(__lowercase    ,   'wb'   ) as fi:
                      __lowercase      		=self.sp_model.serialized_model_proto()
                      fi.write(__lowercase   )

            return (out_vocab_file,)





'''simple docstring'''

def 					__UpperCamelCase				(						lowercase__    :	int			):






     '''simple docstring'''





     if n == 1 or not isinstance(lowercase__,       lowercase__			):
          return 0
     elif n == 2:
          return 1
     else:
          __lowercase      		=[0, 1]
          for i in range(2,       n + 1			):
               sequence.append(sequence[i - 1] + sequence[i - 2]			)

          return sequence[n]

def 					__UpperCamelCase				(						lowercase__    :	int			):






     '''simple docstring'''





     __lowercase      		=0
     __lowercase      		=2

     while digits < n:
          index += 1
          __lowercase      		=len(str(fibonacci(lowercase__			)			)			)

     return index

def 					__UpperCamelCase				(						lowercase__    :	int = 10_00			):






     '''simple docstring'''





     return fibonacci_digits_index(lowercase__			)


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


