




'''simple docstring'''



import warnings

from transformers import AutoTokenizer
from transformers.utils import is_torch_available
from transformers.utils.generic import ExplicitEnum

from ...processing_utils import ProcessorMixin


if is_torch_available():
	import torch







class 		lowercase_   (			A       ):


			"""simple docstring"""

			lowerCamelCase_      =						'''char'''
			lowerCamelCase_      =						'''bpe'''
			lowerCamelCase_      =						'''wp'''


lowerCamelCase_			=						(DecodeType.CHARACTER, DecodeType.BPE, DecodeType.WORDPIECE)







class 		lowercase_   (			A       ):


			"""simple docstring"""

			lowerCamelCase_      =						['''image_processor''', '''char_tokenizer''']
			lowerCamelCase_      =						'''ViTImageProcessor'''
			lowerCamelCase_      =						'''MgpstrTokenizer'''



			def __init__(   self :     Union[str, Any]  ,				__lowerCamelCase :     Dict=None  ,				__lowerCamelCase :     List[Any]=None  ,				**__lowerCamelCase :     Any   ):

						"""simple docstring"""
						_SCREAMING_SNAKE_CASE	=				None
						if "feature_extractor" in kwargs:
									warnings.warn(
									    "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
									    " instead."  ,				_snake_case  ,				)
									_SCREAMING_SNAKE_CASE	=				kwargs.pop("feature_extractor"   )

						_SCREAMING_SNAKE_CASE	=				image_processor if image_processor is not None else feature_extractor
						if image_processor is None:
									raise ValueError("You need to specify an `image_processor`."   )
						if tokenizer is None:
									raise ValueError("You need to specify a `tokenizer`."   )

						_SCREAMING_SNAKE_CASE	=				tokenizer
						_SCREAMING_SNAKE_CASE	=				AutoTokenizer.from_pretrained("gpt2"   )
						_SCREAMING_SNAKE_CASE	=				AutoTokenizer.from_pretrained("bert-base-uncased"   )

						super().__init__(_snake_case  ,				_snake_case   )



			def __call__(   self :     Dict  ,				__lowerCamelCase :     Tuple=None  ,				__lowerCamelCase :     Optional[int]=None  ,				__lowerCamelCase :     Tuple=None  ,				**__lowerCamelCase :     Dict   ):

						"""simple docstring"""




						if images is None and text is None:
									raise ValueError("You need to specify either an `images` or `text` input to process."   )

						if images is not None:
									_SCREAMING_SNAKE_CASE	=				self.image_processor(_snake_case  ,				return_tensors=_snake_case  ,				**_snake_case   )
						if text is not None:
									_SCREAMING_SNAKE_CASE	=				self.char_tokenizer(_snake_case  ,				return_tensors=_snake_case  ,				**_snake_case   )

						if text is None:
									return inputs
						elif images is None:
									return encodings
						else:
									_SCREAMING_SNAKE_CASE	=				encodings["input_ids"]
									return inputs



			def 							lowerCAmelCase_      (   self :     int  ,				__lowerCamelCase :     Dict   ):

						"""simple docstring"""
						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				sequences
						_SCREAMING_SNAKE_CASE	=				char_preds.size(0   )

						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				self._decode_helper(_snake_case  ,				"char"   )
						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				self._decode_helper(_snake_case  ,				"bpe"   )
						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				self._decode_helper(_snake_case  ,				"wp"   )

						_SCREAMING_SNAKE_CASE	=				[]
						_SCREAMING_SNAKE_CASE	=				[]
						for i in range(_snake_case   ):
									_SCREAMING_SNAKE_CASE	=				[char_scores[i], bpe_scores[i], wp_scores[i]]
									_SCREAMING_SNAKE_CASE	=				[char_strs[i], bpe_strs[i], wp_strs[i]]
									_SCREAMING_SNAKE_CASE	=				scores.index(max(_snake_case   )   )
									final_strs.append(strs[max_score_index]   )
									final_scores.append(scores[max_score_index]   )

						_SCREAMING_SNAKE_CASE	=				{}
						_SCREAMING_SNAKE_CASE	=				final_strs
						_SCREAMING_SNAKE_CASE	=				final_scores
						_SCREAMING_SNAKE_CASE	=				char_strs
						_SCREAMING_SNAKE_CASE	=				bpe_strs
						_SCREAMING_SNAKE_CASE	=				wp_strs
						return out



			def 							lowerCAmelCase_      (   self :     Optional[int]  ,				__lowerCamelCase :     int  ,				__lowerCamelCase :     Union[str, Any]   ):

						"""simple docstring"""




						if format == DecodeType.CHARACTER:
									_SCREAMING_SNAKE_CASE	=				self.char_decode
									_SCREAMING_SNAKE_CASE	=				1
									_SCREAMING_SNAKE_CASE	=				"[s]"
						elif format == DecodeType.BPE:
									_SCREAMING_SNAKE_CASE	=				self.bpe_decode
									_SCREAMING_SNAKE_CASE	=				2
									_SCREAMING_SNAKE_CASE	=				"#"
						elif format == DecodeType.WORDPIECE:
									_SCREAMING_SNAKE_CASE	=				self.wp_decode
									_SCREAMING_SNAKE_CASE	=				1_0_2
									_SCREAMING_SNAKE_CASE	=				"[SEP]"
						else:
									raise ValueError(F"""Format {format} is not supported."""   )

						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				[], []
						_SCREAMING_SNAKE_CASE	=				pred_logits.size(0   )
						_SCREAMING_SNAKE_CASE	=				pred_logits.size(1   )
						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				pred_logits.topk(1  ,				dim=-1  ,				largest=_snake_case  ,				sorted=_snake_case   )
						_SCREAMING_SNAKE_CASE	=				preds_index.view(-1  ,				_snake_case   )[:, 1:]
						_SCREAMING_SNAKE_CASE	=				decoder(_snake_case   )
						_SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				torch.nn.functional.softmax(_snake_case  ,				dim=2   ).max(dim=2   )
						_SCREAMING_SNAKE_CASE	=				preds_max_prob[:, 1:]

						for index in range(_snake_case   ):
									_SCREAMING_SNAKE_CASE	=				preds_str[index].find(_snake_case   )
									_SCREAMING_SNAKE_CASE	=				preds_str[index][:pred_eos]
									_SCREAMING_SNAKE_CASE	=				preds_index[index].cpu().tolist()
									_SCREAMING_SNAKE_CASE	=				pred_index.index(_snake_case   ) if eos_token in pred_index else -1
									_SCREAMING_SNAKE_CASE	=				preds_max_prob[index][: pred_eos_index + 1]
									_SCREAMING_SNAKE_CASE	=				pred_max_prob.cumprod(dim=0   )[-1] if pred_max_prob.nelement() != 0 else 0.0
									dec_strs.append(_snake_case   )
									conf_scores.append(_snake_case   )

						return dec_strs, conf_scores



			def 							lowerCAmelCase_      (   self :     Dict  ,				__lowerCamelCase :     int   ):

						"""simple docstring"""
						_SCREAMING_SNAKE_CASE	=				[seq.replace(" "  ,				""   ) for seq in self.char_tokenizer.batch_decode(_snake_case   )]
						return decode_strs



			def 							lowerCAmelCase_      (   self :     Union[str, Any]  ,				__lowerCamelCase :     str   ):

						"""simple docstring"""
						return self.bpe_tokenizer.batch_decode(_snake_case   )



			def 							lowerCAmelCase_      (   self :     int  ,				__lowerCamelCase :     Optional[Any]   ):

						"""simple docstring"""
						_SCREAMING_SNAKE_CASE	=				[seq.replace(" "  ,				""   ) for seq in self.wp_tokenizer.batch_decode(_snake_case   )]
						return decode_strs







'''simple docstring'''



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

      return sequence[n]
def 			SCREAMING_SNAKE_CASE_			(							__A    :			int  )			->			int:
   _SCREAMING_SNAKE_CASE	=				0
   _SCREAMING_SNAKE_CASE	=				2

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

   return index
def 			SCREAMING_SNAKE_CASE_			(							__A    :			int = 10_00  )			->			int:
   return fibonacci_digits_index(__A  )


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

