

"""simple docstring"""


import os
import unicodedata
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


__A						   =			logging.get_logger(__name__)
__A						   =			{'''vocab_file''': '''spiece.model'''}

__A						   =			{
    '''vocab_file''': {
        '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/spiece.model''',
        '''albert-large-v1''': '''https://huggingface.co/albert-large-v1/resolve/main/spiece.model''',
        '''albert-xlarge-v1''': '''https://huggingface.co/albert-xlarge-v1/resolve/main/spiece.model''',
        '''albert-xxlarge-v1''': '''https://huggingface.co/albert-xxlarge-v1/resolve/main/spiece.model''',
        '''albert-base-v2''': '''https://huggingface.co/albert-base-v2/resolve/main/spiece.model''',
        '''albert-large-v2''': '''https://huggingface.co/albert-large-v2/resolve/main/spiece.model''',
        '''albert-xlarge-v2''': '''https://huggingface.co/albert-xlarge-v2/resolve/main/spiece.model''',
        '''albert-xxlarge-v2''': '''https://huggingface.co/albert-xxlarge-v2/resolve/main/spiece.model''',
    }
}

__A						   =			{
    '''albert-base-v1''': 512,
    '''albert-large-v1''': 512,
    '''albert-xlarge-v1''': 512,
    '''albert-xxlarge-v1''': 512,
    '''albert-base-v2''': 512,
    '''albert-large-v2''': 512,
    '''albert-xlarge-v2''': 512,
    '''albert-xxlarge-v2''': 512,
}

__A						   =			'''▁'''





class     snake_case	(				_snake_case  ):
				SCREAMING_SNAKE_CASE_   :      List[Any]         =  VOCAB_FILES_NAMES
				SCREAMING_SNAKE_CASE_   :      Optional[Any]         =  PRETRAINED_VOCAB_FILES_MAP
				SCREAMING_SNAKE_CASE_   :      Dict         =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES

				def __init__(	self							:				Union[str, Any]     ,  UpperCamelCase__							:				int     ,  UpperCamelCase__							:				Tuple=True     ,  UpperCamelCase__							:				Optional[Any]=True     ,  UpperCamelCase__							:				List[str]=False     ,  UpperCamelCase__							:				Union[str, Any]="[CLS]"     ,  UpperCamelCase__							:				Optional[int]="[SEP]"     ,  UpperCamelCase__							:				List[Any]="<unk>"     ,  UpperCamelCase__							:				List[str]="[SEP]"     ,  UpperCamelCase__							:				int="<pad>"     ,  UpperCamelCase__							:				Dict="[CLS]"     ,  UpperCamelCase__							:				List[str]="[MASK]"     ,  UpperCamelCase__							:				int = None     ,  **UpperCamelCase__							:				Optional[int]     ,  )->   Dict:



						'''simple docstring'''


						__lowerCAmelCase:       str          =			(
						    AddedToken(_lowerCamelCase     ,  lstrip=_lowerCamelCase     ,  rstrip=_lowerCamelCase     ,  normalized=_lowerCamelCase)
						    if isinstance(_lowerCamelCase     ,  _lowerCamelCase)
						    else mask_token
						)

						__lowerCAmelCase:       str          =			{} if sp_model_kwargs is None else sp_model_kwargs

						super().__init__(
						    do_lower_case=_lowerCamelCase     ,  remove_space=_lowerCamelCase     ,  keep_accents=_lowerCamelCase     ,  bos_token=_lowerCamelCase     ,  eos_token=_lowerCamelCase     ,  unk_token=_lowerCamelCase     ,  sep_token=_lowerCamelCase     ,  pad_token=_lowerCamelCase     ,  cls_token=_lowerCamelCase     ,  mask_token=_lowerCamelCase     ,  sp_model_kwargs=self.sp_model_kwargs     ,  **_lowerCamelCase     ,  )

						__lowerCAmelCase:       List[Any]          =			do_lower_case
						__lowerCAmelCase:       int          =			remove_space
						__lowerCAmelCase:       List[Any]          =			keep_accents
						__lowerCAmelCase:       Optional[int]          =			vocab_file

						__lowerCAmelCase:       Tuple          =			spm.SentencePieceProcessor(**self.sp_model_kwargs)
						self.sp_model.Load(_lowerCamelCase)

				@property
				def 							lowercase_     (	self							:				Tuple)->   Any:



						'''simple docstring'''


						return len(self.sp_model)

				def 							lowercase_     (	self							:				Union[str, Any])->   Union[str, Any]:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[Any]          =			{self.convert_ids_to_tokens(_lowerCamelCase): i for i in range(self.vocab_size)}
						vocab.update(self.added_tokens_encoder)
						return vocab

				def __getstate__(	self							:				Tuple)->   Any:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[int]          =			self.__dict__.copy()
						__lowerCAmelCase:       int          =			None
						return state

				def __setstate__(	self							:				Any     ,  UpperCamelCase__							:				List[Any])->   List[str]:



						'''simple docstring'''


						__lowerCAmelCase:       Union[str, Any]          =			d

						# for backward compatibility
						if not hasattr(self     ,  "sp_model_kwargs"):
								__lowerCAmelCase:       Any          =			{}

						__lowerCAmelCase:       List[Any]          =			spm.SentencePieceProcessor(**self.sp_model_kwargs)
						self.sp_model.Load(self.vocab_file)

				def 							lowercase_     (	self							:				List[Any]     ,  UpperCamelCase__							:				Union[str, Any])->   Tuple:



						'''simple docstring'''


						if self.remove_space:
								__lowerCAmelCase:       int          =			''' '''.join(inputs.strip().split())
						else:
								__lowerCAmelCase:       Tuple          =			inputs
						__lowerCAmelCase:       Tuple          =			outputs.replace("``"     ,  "\"").replace("\'\'"     ,  "\"")

						if not self.keep_accents:
								__lowerCAmelCase:       List[str]          =			unicodedata.normalize("NFKD"     ,  _lowerCamelCase)
								__lowerCAmelCase:       List[str]          =			''''''.join([c for c in outputs if not unicodedata.combining(_lowerCamelCase)])
						if self.do_lower_case:
								__lowerCAmelCase:       Tuple          =			outputs.lower()

						return outputs

				def 							lowercase_     (	self							:				Union[str, Any]     ,  UpperCamelCase__							:				int)->   Optional[int]:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[Any]          =			self.preprocess_text(_lowerCamelCase)
						__lowerCAmelCase:       int          =			self.sp_model.encode(_lowerCamelCase     ,  out_type=_lowerCamelCase)
						__lowerCAmelCase:       Tuple          =			[]
						for piece in pieces:
								if len(_lowerCamelCase) > 1 and piece[-1] == str(",") and piece[-2].isdigit():
										__lowerCAmelCase:       int          =			self.sp_model.EncodeAsPieces(piece[:-1].replace(_lowerCamelCase     ,  ""))
										if piece[0] != SPIECE_UNDERLINE and cur_pieces[0][0] == SPIECE_UNDERLINE:
												if len(cur_pieces[0]) == 1:
														__lowerCAmelCase:       List[str]          =			cur_pieces[1:]
												else:
														__lowerCAmelCase:       Optional[Any]          =			cur_pieces[0][1:]
										cur_pieces.append(piece[-1])
										new_pieces.extend(_lowerCamelCase)
								else:
										new_pieces.append(_lowerCamelCase)

						return new_pieces

				def 							lowercase_     (	self							:				str     ,  UpperCamelCase__							:				Any)->   Any:



						'''simple docstring'''


						return self.sp_model.PieceToId(_lowerCamelCase)

				def 							lowercase_     (	self							:				int     ,  UpperCamelCase__							:				Tuple)->   List[str]:



						'''simple docstring'''


						return self.sp_model.IdToPiece(_lowerCamelCase)

				def 							lowercase_     (	self							:				List[str]     ,  UpperCamelCase__							:				int)->   Optional[Any]:



						'''simple docstring'''


						__lowerCAmelCase:       Dict          =			[]
						__lowerCAmelCase:       List[Any]          =			''''''
						__lowerCAmelCase:       str          =			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(_lowerCamelCase) + token
										__lowerCAmelCase:       Optional[int]          =			True
										__lowerCAmelCase:       str          =			[]
								else:
										current_sub_tokens.append(_lowerCamelCase)
										__lowerCAmelCase:       Optional[int]          =			False
						out_string += self.sp_model.decode(_lowerCamelCase)
						return out_string.strip()

				def 							lowercase_     (	self							:				List[Any]     ,  UpperCamelCase__							:				Optional[Any]     ,  UpperCamelCase__							:				Any = None)->   Optional[int]:



						'''simple docstring'''


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

				def 							lowercase_     (	self							:				Optional[int]     ,  UpperCamelCase__							:				int     ,  UpperCamelCase__							:				Optional[int] = None     ,  UpperCamelCase__							:				Optional[Any] = False)->   List[Any]:



						'''simple docstring'''


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

						if token_ids_a is not None:
								return [1] + ([0] * len(_lowerCamelCase)) + [1] + ([0] * len(_lowerCamelCase)) + [1]
						return [1] + ([0] * len(_lowerCamelCase)) + [1]

				def 							lowercase_     (	self							:				str     ,  UpperCamelCase__							:				Optional[int]     ,  UpperCamelCase__							:				Optional[Any] = None)->   Dict:



						'''simple docstring'''


						__lowerCAmelCase:       Union[str, Any]          =			[self.sep_token_id]
						__lowerCAmelCase:       Optional[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 							lowercase_     (	self							:				Dict     ,  UpperCamelCase__							:				List[str]     ,  UpperCamelCase__							:				Any = None)->   Optional[Any]:



						'''simple docstring'''


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

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

						return (out_vocab_file,)






def 				__lowerCamelCase						( UpperCAmelCase_						:		int = 1000						):




      """simple docstring"""





      a							,				a						:int 							=       1, 1
      a						:Any 							=       2
      while True:
            a						:Optional[int] 							=       0
            a						:str 							=       fa + fa
            a							,				a						:List[Any] 							=       fa, f
            index += 1
            for _ in str(UpperCAmelCase_						):
                  i += 1
            if i == n:
                  break
      return index


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





