
import json
from typing import List, Optional, Tuple

from tokenizers import normalizers
from tokenizers.pre_tokenizers import BertPreTokenizer, PreTokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_roformer import RoFormerTokenizer
from .tokenization_utils import JiebaPreTokenizer


lowercase  : Dict						   =							logging.get_logger(__name__)

lowercase  : Union[str, Any]						   =							{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

lowercase  : Union[str, Any]						   =							{
    """vocab_file""": {
        """junnyu/roformer_chinese_small""": """https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt""",
        """junnyu/roformer_chinese_base""": """https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt""",
        """junnyu/roformer_chinese_char_small""": (
            """https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_chinese_char_base""": (
            """https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_small_discriminator""": (
            """https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_small_generator""": (
            """https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt"""
        ),
    }
}

lowercase  : Optional[Any]						   =							{
    """junnyu/roformer_chinese_small""": 1536,
    """junnyu/roformer_chinese_base""": 1536,
    """junnyu/roformer_chinese_char_small""": 512,
    """junnyu/roformer_chinese_char_base""": 512,
    """junnyu/roformer_small_discriminator""": 128,
    """junnyu/roformer_small_generator""": 128,
}


lowercase  : List[str]						   =							{
    """junnyu/roformer_chinese_small""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_base""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_char_small""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_char_base""": {"""do_lower_case""": True},
    """junnyu/roformer_small_discriminator""": {"""do_lower_case""": True},
    """junnyu/roformer_small_generator""": {"""do_lower_case""": True},
}

class __snake_case		(				lowerCAmelCase					):
    _a		:						Union[str, Any]=    VOCAB_FILES_NAMES
    _a		:						str=    PRETRAINED_VOCAB_FILES_MAP
    _a		:						Union[str, Any]=    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    _a		:						List[str]=    PRETRAINED_INIT_CONFIGURATION
    _a		:						int=    RoFormerTokenizer
    def __init__(  self		,snake_case=None		,snake_case=None		,snake_case=True		,snake_case="[UNK]"		,snake_case="[SEP]"		,snake_case="[PAD]"		,snake_case="[CLS]"		,snake_case="[MASK]"		,snake_case=True		,snake_case=None		,**snake_case		,):



           '''simple docstring'''







           super().__init__(
               snake_case		,tokenizer_file=snake_case		,do_lower_case=snake_case		,unk_token=snake_case		,sep_token=snake_case		,pad_token=snake_case		,cls_token=snake_case		,mask_token=snake_case		,tokenize_chinese_chars=snake_case		,strip_accents=snake_case		,**snake_case		,)

           lowercase							:					List[str]	     =				json.loads(self.backend_tokenizer.normalizer.__getstate__()				)
           if (
               pre_tok_state.get("""lowercase"""		,snake_case				) != do_lower_case
               or pre_tok_state.get("""strip_accents"""		,snake_case				) != strip_accents
           ):
                  lowercase							:					Optional[int]	     =				getattr(snake_case		,pre_tok_state.pop("""type"""				)				)
                  lowercase							:					List[str]	     =				do_lower_case
                  lowercase							:					List[str]	     =				strip_accents
                  lowercase							:					Any	     =				pre_tok_class(**snake_case				)

           lowercase							:					str	     =				do_lower_case
    def __getstate__(  self				):



           '''simple docstring'''







           lowercase							:					Optional[Any]	     =				self.__dict__.copy()
           lowercase							:					Optional[Any]	     =				BertPreTokenizer()
           return state
    def __setstate__(  self		,snake_case				):



           '''simple docstring'''







           lowercase							:					Any	     =				d
           lowercase							:					List[str]	     =				self.__dict__["""_tokenizer"""].get_vocab()
           lowercase							:					Optional[int]	     =				PreTokenizer.custom(JiebaPreTokenizer(snake_case				)				)
    def 				_SCREAMING_SNAKE_CASE	(  self		,snake_case		,snake_case=None				):



           '''simple docstring'''







           lowercase							:					int	     =				[self.cls_token_id] + token_ids_a + [self.sep_token_id]

           if token_ids_a:
                  output += token_ids_a + [self.sep_token_id]

           return output
    def 				_SCREAMING_SNAKE_CASE	(  self		,snake_case		,snake_case = None				):



           '''simple docstring'''







           lowercase							:					Any	     =				[self.sep_token_id]
           lowercase							:					List[Any]	     =				[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				) * [0] + len(token_ids_a + sep				) * [1]
    def 				_SCREAMING_SNAKE_CASE	(  self		,snake_case		,snake_case = None				):



           '''simple docstring'''







           lowercase							:					Optional[int]	     =				self._tokenizer.model.save(snake_case		,name=snake_case				)
           return tuple(snake_case				)
    def 				_SCREAMING_SNAKE_CASE	(  self		,snake_case		,snake_case=None		,snake_case=None		,snake_case=False		,**snake_case		,):



           '''simple docstring'''







           lowercase							:					Optional[Any]	     =				BertPreTokenizer()
           return super().save_pretrained(snake_case		,snake_case		,snake_case		,snake_case		,**snake_case				)


from collections.abc import Generator







def 						_snake_case(  )			->   Generator[int, None, None]:
       lowercase     ,      lowercase							:					List[str]	     =				0, 1
       while True:
              lowercase     ,      lowercase							:					Optional[int]	     =				b, a + b
              yield b







def 						_snake_case(  SCREAMING_SNAKE_CASE__ = 1_000    )			->   int:
       lowercase							:					List[Any]	     =				1
       lowercase							:					Tuple	     =				fibonacci_generator()
       while len(str(next(SCREAMING_SNAKE_CASE__    )    )    ) < n:
              answer += 1
       return answer + 1


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