






"""simple docstring"""



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_base import BatchEncoding
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import PaddingStrategy, logging
from .tokenization_realm import RealmTokenizer


__A		:       Tuple  				=		logging.get_logger(__name__)

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

__A		:       Tuple  				=		{
    '''vocab_file''': {
        '''google/realm-cc-news-pretrained-embedder''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/vocab.txt'''
        ),
        '''google/realm-cc-news-pretrained-encoder''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/vocab.txt'''
        ),
        '''google/realm-cc-news-pretrained-scorer''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/vocab.txt'''
        ),
        '''google/realm-cc-news-pretrained-openqa''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/vocab.txt'''
        ),
        '''google/realm-orqa-nq-openqa''': '''https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/vocab.txt''',
        '''google/realm-orqa-nq-reader''': '''https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/vocab.txt''',
        '''google/realm-orqa-wq-openqa''': '''https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/vocab.txt''',
        '''google/realm-orqa-wq-reader''': '''https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/vocab.txt''',
    },
    '''tokenizer_file''': {
        '''google/realm-cc-news-pretrained-embedder''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/tokenizer.jsont'''
        ),
        '''google/realm-cc-news-pretrained-encoder''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/tokenizer.json'''
        ),
        '''google/realm-cc-news-pretrained-scorer''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/tokenizer.json'''
        ),
        '''google/realm-cc-news-pretrained-openqa''': (
            '''https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/tokenizer.json'''
        ),
        '''google/realm-orqa-nq-openqa''': (
            '''https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/tokenizer.json'''
        ),
        '''google/realm-orqa-nq-reader''': (
            '''https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/tokenizer.json'''
        ),
        '''google/realm-orqa-wq-openqa''': (
            '''https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/tokenizer.json'''
        ),
        '''google/realm-orqa-wq-reader''': (
            '''https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/tokenizer.json'''
        ),
    },
}

__A		:       Optional[int]  				=		{
    '''google/realm-cc-news-pretrained-embedder''': 512,
    '''google/realm-cc-news-pretrained-encoder''': 512,
    '''google/realm-cc-news-pretrained-scorer''': 512,
    '''google/realm-cc-news-pretrained-openqa''': 512,
    '''google/realm-orqa-nq-openqa''': 512,
    '''google/realm-orqa-nq-reader''': 512,
    '''google/realm-orqa-wq-openqa''': 512,
    '''google/realm-orqa-wq-reader''': 512,
}

__A		:       Optional[int]  				=		{
    '''google/realm-cc-news-pretrained-embedder''': {'''do_lower_case''': True},
    '''google/realm-cc-news-pretrained-encoder''': {'''do_lower_case''': True},
    '''google/realm-cc-news-pretrained-scorer''': {'''do_lower_case''': True},
    '''google/realm-cc-news-pretrained-openqa''': {'''do_lower_case''': True},
    '''google/realm-orqa-nq-openqa''': {'''do_lower_case''': True},
    '''google/realm-orqa-nq-reader''': {'''do_lower_case''': True},
    '''google/realm-orqa-wq-openqa''': {'''do_lower_case''': True},
    '''google/realm-orqa-wq-reader''': {'''do_lower_case''': True},
}





class 					_UpperCAmelCase       ( _A							):
					SCREAMING_SNAKE_CASE_		:				List[Any]							    =   VOCAB_FILES_NAMES
					SCREAMING_SNAKE_CASE_		:				List[Any]							    =   PRETRAINED_VOCAB_FILES_MAP
					SCREAMING_SNAKE_CASE_		:				Any							    =   PRETRAINED_INIT_CONFIGURATION
					SCREAMING_SNAKE_CASE_		:				str							    =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					SCREAMING_SNAKE_CASE_		:				Any							    =   RealmTokenizer




					def __init__(				self     :						str    ,						A     :						Optional[int]=None    ,						A     :						int=None    ,						A     :						Union[str, Any]=True    ,						A     :						str="[UNK]"    ,						A     :						Dict="[SEP]"    ,						A     :						Dict="[PAD]"    ,						A     :						List[str]="[CLS]"    ,						A     :						List[str]="[MASK]"    ,						A     :						Dict=True    ,						A     :						Union[str, Any]=None    ,						**A     :						int    ,						)  ->  Optional[Any]:
							super().__init__(
							    A    ,						tokenizer_file=A    ,						do_lower_case=A    ,						unk_token=A    ,						sep_token=A    ,						pad_token=A    ,						cls_token=A    ,						mask_token=A    ,						tokenize_chinese_chars=A    ,						strip_accents=A    ,						**A    ,						)

							lowercase_ : int							       =   json.loads(self.backend_tokenizer.normalizer.__getstate__()   )
							if (
							    normalizer_state.get('''lowercase'''    ,						A   ) != do_lower_case
							    or normalizer_state.get('''strip_accents'''    ,						A   ) != strip_accents
							    or normalizer_state.get('''handle_chinese_chars'''    ,						A   ) != tokenize_chinese_chars
							):
									lowercase_ : Tuple							       =   getattr(A    ,						normalizer_state.pop('''type'''   )   )
									lowercase_ : Optional[Any]							       =   do_lower_case
									lowercase_ : Optional[Any]							       =   strip_accents
									lowercase_ : Optional[Any]							       =   tokenize_chinese_chars
									lowercase_ : int							       =   normalizer_class(**A   )

							lowercase_ : Tuple							       =   do_lower_case




					def   A  (				self     :						Union[str, Any]    ,						A     :						int    ,						**A     :						Dict   )  ->  List[Any]:
							lowercase_ : Optional[Any]							       =   PaddingStrategy.MAX_LENGTH

							lowercase_ : Tuple							       =   text
							lowercase_ : List[str]							       =   kwargs.pop('''text_pair'''    ,						A   )
							lowercase_ : Optional[int]							       =   kwargs.pop('''return_tensors'''    ,						A   )

							lowercase_ : List[Any]							       =   {
							    '''input_ids''': [],
							    '''attention_mask''': [],
							    '''token_type_ids''': [],
							}

							for idx, candidate_text in enumerate(A   ):
									if batch_text_pair is not None:
											lowercase_ : List[str]							       =   batch_text_pair[idx]
									else:
											lowercase_ : Optional[int]							       =   None

									lowercase_ : Optional[Any]							       =   super().__call__(A    ,						A    ,						return_tensors=A    ,						**A   )

									lowercase_ : Tuple							       =   encoded_candidates.get('''input_ids'''   )
									lowercase_ : List[Any]							       =   encoded_candidates.get('''attention_mask'''   )
									lowercase_ : Dict							       =   encoded_candidates.get('''token_type_ids'''   )

									if encoded_input_ids is not None:
											output_data["input_ids"].append(A   )
									if encoded_attention_mask is not None:
											output_data["attention_mask"].append(A   )
									if encoded_token_type_ids is not None:
											output_data["token_type_ids"].append(A   )

							lowercase_ : List[str]							       =   {key: item for key, item in output_data.items() if len(A   ) != 0}

							return BatchEncoding(A    ,						tensor_type=A   )




					def   A  (				self     :						Any    ,						A     :						Union[str, Any]    ,						A     :						Optional[int]=None   )  ->  List[str]:
							lowercase_ : Dict							       =   [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   A  (				self     :						List[str]    ,						A     :						List[int]    ,						A     :						Optional[List[int]] = None   )  ->  List[int]:
							lowercase_ : List[Any]							       =   [self.sep_token_id]
							lowercase_ : int							       =   [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   A  (				self     :						List[Any]    ,						A     :						str    ,						A     :						Optional[str] = None   )  ->  Tuple[str]:
							lowercase_ : Optional[int]							       =   self._tokenizer.model.save(A    ,						name=A   )
							return tuple(A   )











"""simple docstring"""



def 						lowercase    (				__snake_case				: int = 1_0_0_0	):
		lowercase_       ,					lowercase_ : str							       =   1, 1
		lowercase_ : List[str]							       =   2
		while True:
				lowercase_ : Tuple							       =   0
				lowercase_ : List[Any]							       =   fa + fa
				lowercase_       ,					lowercase_ : Optional[int]							       =   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())))



