
def 						UpperCAmelCase			(	a_						)		->	int:







				"""simple docstring"""



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

								return sequence[n]


def 						UpperCAmelCase			(	a_						)		->	int:







				"""simple docstring"""



				__A   			= 0
				__A   			= 2

				while digits < n:
								index += 1
								__A   			= len(str(fibonacci(a_						)						)						)

				return index


def 						UpperCAmelCase			(	a_ = 1_0_0_0						)		->	int:







				"""simple docstring"""



				return fibonacci_digits_index(a_						)


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


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


SCREAMING_SNAKE_CASE							:Optional[int]							 =				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE							:Optional[int]							 =				{'vocab_file': 'sentencepiece.bpe.model'}

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

SCREAMING_SNAKE_CASE							:List[Any]							 =				{
    'camembert-base': 512,
}

SCREAMING_SNAKE_CASE							:List[str]							 =				'▁'





class 							UpperCAmelCase      (  __SCREAMING_SNAKE_CASE  ):




	'''simple docstring'''





	snake_case_					    =     VOCAB_FILES_NAMES
	snake_case_					    =     PRETRAINED_VOCAB_FILES_MAP
	snake_case_					    =     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	snake_case_					    =     ["input_ids", "attention_mask"]






	def __init__(       self					: Optional[Any]							,A					: List[str]							,A					: List[Any]="<s>"							,A					: Tuple="</s>"							,A					: Any="</s>"							,A					: Optional[Any]="<s>"							,A					: Tuple="<unk>"							,A					: str="<pad>"							,A					: int="<mask>"							,A					: Optional[int]=["<s>NOTUSED", "</s>NOTUSED"]							,A					: Optional[Dict[str, Any]] = None							,**A					: Optional[Any]							,):
					# Mask token behave like a normal word, i.e. include the space before it
					__A   			= AddedToken(A							,lstrip=A							,rstrip=A ) if isinstance(A							,A ) else mask_token

					__A   			= {} if sp_model_kwargs is None else sp_model_kwargs

					super().__init__(
					    bos_token=A							,eos_token=A							,unk_token=A							,sep_token=A							,cls_token=A							,pad_token=A							,mask_token=A							,additional_special_tokens=A							,sp_model_kwargs=self.sp_model_kwargs							,**A							,)
					__A   			= spm.SentencePieceProcessor(**self.sp_model_kwargs )
					self.sp_model.Load(str(A ) )
					__A   			= 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>
					__A   			= {"<s>NOTUSED": 0, "<pad>": 1, "</s>NOTUSED": 2, "<unk>": 3}
					__A   			= len(self.fairseq_tokens_to_ids )
					__A   			= len(self.sp_model ) + len(self.fairseq_tokens_to_ids )
					__A   			= {v: k for k, v in self.fairseq_tokens_to_ids.items()}






	def 				UpperCamelCase_  (       self					: int							,A					: List[int]							,A					: Optional[List[int]] = None ):

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






	def 				UpperCamelCase_  (       self					: Dict							,A					: List[int]							,A					: Optional[List[int]] = None							,A					: bool = False ):
					if already_has_special_tokens:
									return super().get_special_tokens_mask(
									    token_ids_a=A							,token_ids_a=A							,already_has_special_tokens=A )

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






	def 				UpperCamelCase_  (       self					: Union[str, Any]							,A					: List[int]							,A					: Optional[List[int]] = None ):
					__A   			= [self.sep_token_id]
					__A   			= [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 				UpperCamelCase_  (       self					: Dict ):
					return len(self.fairseq_tokens_to_ids ) + len(self.sp_model )






	def 				UpperCamelCase_  (       self					: int ):
					__A   			= {self.convert_ids_to_tokens(A ): i for i in range(self.vocab_size )}
					vocab.update(self.added_tokens_encoder )
					return vocab






	def 				UpperCamelCase_  (       self					: Any							,A					: str ):
					return self.sp_model.encode(A							,out_type=A )






	def 				UpperCamelCase_  (       self					: List[str]							,A					: Dict ):
					if token in self.fairseq_tokens_to_ids:
									return self.fairseq_tokens_to_ids[token]
					elif self.sp_model.PieceToId(A ) == 0:
									# Convert sentence piece unk token to fairseq unk token index
									return self.unk_token_id
					return self.fairseq_offset + self.sp_model.PieceToId(A )






	def 				UpperCamelCase_  (       self					: Dict							,A					: Tuple ):
					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 				UpperCamelCase_  (       self					: Optional[Any]							,A					: Dict ):
					__A   			= []
					__A   			= ""
					__A   			= 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(A ) + token
													__A   			= True
													__A   			= []
									else:
													current_sub_tokens.append(A )
													__A   			= False
					out_string += self.sp_model.decode(A )
					return out_string.strip()






	def __getstate__(       self					: Dict ):
					__A   			= self.__dict__.copy()
					__A   			= None
					return state






	def __setstate__(       self					: Union[str, Any]							,A					: Any ):
					__A   			= d

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

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







	def 				UpperCamelCase_  (       self					: Any							,A					: str							,A					: Optional[str] = None ):
					if not os.path.isdir(A ):
									logger.error(f'''Vocabulary path ({save_directory}) should be a directory''' )
									return
					__A   			= os.path.join(
					    A							,(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"] )

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

					return (out_vocab_file,)
