






'''simple docstring'''



import unittest

import numpy as np

from transformers import RoFormerConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
 import jax.numpy as jnp

 from transformers.models.roformer.modeling_flax_roformer import (
     FlaxRoFormerForMaskedLM,
     FlaxRoFormerForMultipleChoice,
     FlaxRoFormerForQuestionAnswering,
     FlaxRoFormerForSequenceClassification,
     FlaxRoFormerForTokenClassification,
     FlaxRoFormerModel,
 )
class 				__SCREAMING_SNAKE_CASE							(				unittest.TestCase  ):




      def __init__(	self			, lowerCamelCase			, lowerCamelCase=13			, lowerCamelCase=7			, lowerCamelCase=True			, lowerCamelCase=True			, lowerCamelCase=True			, lowerCamelCase=True			, lowerCamelCase=99			, lowerCamelCase=32			, lowerCamelCase=5			, lowerCamelCase=4			, lowerCamelCase=37			, lowerCamelCase="gelu"			, lowerCamelCase=0.1			, lowerCamelCase=0.1			, lowerCamelCase=512			, lowerCamelCase=16			, lowerCamelCase=2			, lowerCamelCase=0.02			, lowerCamelCase=4			, )				->Tuple:



         '''simple docstring'''
         __a					  =     parent
         __a					  =     batch_size
         __a					  =     seq_length
         __a					  =     is_training
         __a					  =     use_attention_mask
         __a					  =     use_token_type_ids
         __a					  =     use_labels
         __a					  =     vocab_size
         __a					  =     hidden_size
         __a					  =     num_hidden_layers
         __a					  =     num_attention_heads
         __a					  =     intermediate_size
         __a					  =     hidden_act
         __a					  =     hidden_dropout_prob
         __a					  =     attention_probs_dropout_prob
         __a					  =     max_position_embeddings
         __a					  =     type_vocab_size
         __a					  =     type_sequence_label_size
         __a					  =     initializer_range
         __a					  =     num_choices




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



         '''simple docstring'''
         __a					  =     ids_tensor([self.batch_size, self.seq_length]			, self.vocab_size   )

         __a					  =     None
         if self.use_attention_mask:
            __a					  =     random_attention_mask([self.batch_size, self.seq_length]   )

         __a					  =     None
         if self.use_token_type_ids:
            __a					  =     ids_tensor([self.batch_size, self.seq_length]			, self.type_vocab_size   )

         __a					  =     RoFormerConfig(
             vocab_size=self.vocab_size			, hidden_size=self.hidden_size			, num_hidden_layers=self.num_hidden_layers			, num_attention_heads=self.num_attention_heads			, intermediate_size=self.intermediate_size			, hidden_act=self.hidden_act			, hidden_dropout_prob=self.hidden_dropout_prob			, attention_probs_dropout_prob=self.attention_probs_dropout_prob			, max_position_embeddings=self.max_position_embeddings			, type_vocab_size=self.type_vocab_size			, is_decoder=SCREAMING_SNAKE_CASE_			, initializer_range=self.initializer_range			, )

         return config, input_ids, token_type_ids, attention_mask






      def 			__UpperCamelCase				(	self   )				->Tuple:



         '''simple docstring'''
         __a					  =     self.prepare_config_and_inputs()
         __a					  =     config_and_inputs
         __a					  =     {"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": attention_mask}
         return config, inputs_dict







@require_flax
class 				__SCREAMING_SNAKE_CASE							(				UpperCAmelCase_   ,   unittest.TestCase  ):
      __a	       =True

      __a	       =(
          (
              FlaxRoFormerModel,
              FlaxRoFormerForMaskedLM,
              FlaxRoFormerForSequenceClassification,
              FlaxRoFormerForTokenClassification,
              FlaxRoFormerForMultipleChoice,
              FlaxRoFormerForQuestionAnswering,
          )
          if is_flax_available()
          else ()
      )




      def 			__UpperCamelCase				(	self   )				->List[str]:



         '''simple docstring'''
         __a					  =     FlaxRoFormerModelTester(self   )






      @slow
      def 			__UpperCamelCase				(	self   )				->Optional[Any]:



         '''simple docstring'''




         for model_class_name in self.all_model_classes:
            __a					  =     model_class_name.from_pretrained('junnyu/roformer_chinese_small'			, from_pt=SCREAMING_SNAKE_CASE_   )
            __a					  =     model(np.ones((1, 1)   )   )
            self.assertIsNotNone(SCREAMING_SNAKE_CASE_   )







@require_flax
class 				__SCREAMING_SNAKE_CASE							(				unittest.TestCase  ):




      @slow
      def 			__UpperCamelCase				(	self   )				->str:



         '''simple docstring'''
         __a					  =     FlaxRoFormerForMaskedLM.from_pretrained('junnyu/roformer_chinese_base'   )
         __a					  =     jnp.array([[0, 1, 2, 3, 4, 5]]   )
         __a					  =     model(SCREAMING_SNAKE_CASE_   )[0]

         __a					  =     5_0000

         __a					  =     (1, 6, vocab_size)
         self.assertEqual(output.shape			, SCREAMING_SNAKE_CASE_   )

         __a					  =     jnp.array(
             [[[-0.1205, -1.0265, 0.2922], [-1.5134, 0.1974, 0.1519], [-5.0135, -3.9003, -0.8404]]]   )

         self.assertTrue(jnp.allclose(output[:, :3, :3]			, SCREAMING_SNAKE_CASE_			, atol=1e-4   )   )

def 		UpperCamelCase						(   lowercase_ )		->						int:


  '''simple docstring'''






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

    return sequence[n]

def 		UpperCamelCase						(   lowercase_ )		->						int:


  '''simple docstring'''






  lowercase__	: Optional[Any]     		=   0
  lowercase__	: Dict     		=   2

  while digits < n:
    index += 1
    lowercase__	: str     		=   len(str(fibonacci(lowercase_ ) ) )

  return index

def 		UpperCamelCase						(   lowercase_ = 10_00 )		->						int:


  '''simple docstring'''






  return fibonacci_digits_index(lowercase_ )


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






