





"""simple docstring"""



from __future__ import annotations

import unittest

import numpy as np

from transformers import BlipTextConfig
from transformers.testing_utils import require_tf, slow
from transformers.utils import is_tf_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask


if is_tf_available():
       import tensorflow as tf

       from transformers import TFBlipTextModel
       from transformers.models.blip.modeling_tf_blip import TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST






class 		__snake_case					:





 """simple docstring"""


 def __init__(    self					,						__lowerCamelCase					,						__lowerCamelCase=12					,						__lowerCamelCase=7					,						__lowerCamelCase=True					,						__lowerCamelCase=True					,						__lowerCamelCase=True					,						__lowerCamelCase=99					,						__lowerCamelCase=32					,						__lowerCamelCase=32					,						__lowerCamelCase=2					,						__lowerCamelCase=4					,						__lowerCamelCase=37					,						__lowerCamelCase=0.1					,						__lowerCamelCase=0.1					,						__lowerCamelCase=512					,						__lowerCamelCase=0.0_2					,						__lowerCamelCase=0					,						__lowerCamelCase=None					,						):



     '''simple docstring'''




     __A    :						List[str]						 =     parent
     __A    :						str						 =     batch_size
     __A    :						Optional[Any]						 =     seq_length
     __A    :						List[str]						 =     is_training
     __A    :						List[str]						 =     use_input_mask
     __A    :						Optional[int]						 =     use_labels
     __A    :						Tuple						 =     vocab_size
     __A    :						int						 =     hidden_size
     __A    :						List[Any]						 =     projection_dim
     __A    :						int						 =     num_hidden_layers
     __A    :						Union[str, Any]						 =     num_attention_heads
     __A    :						Any						 =     intermediate_size
     __A    :						Dict						 =     dropout
     __A    :						int						 =     attention_dropout
     __A    :						Any						 =     max_position_embeddings
     __A    :						str						 =     initializer_range
     __A    :						List[str]						 =     scope
     __A    :						str						 =     bos_token_id

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     __A    :						Any						 =     ids_tensor([self.batch_size, self.seq_length]					,						self.vocab_size  )

     __A    :						int						 =     None
     if self.use_input_mask:
         __A    :						Any						 =     random_attention_mask([self.batch_size, self.seq_length]  )

     if input_mask is not None:
         __A    :						int						 =     input_mask.numpy()
         __A    :						List[str]						 =     input_mask.shape
         __A    :						int						 =     np.random.randint(1					,						seq_length - 1					,						size=(batch_size,)  )
         for batch_idx, start_index in enumerate(lowerCAmelCase__  ):
             __A    :						List[str]						 =     1
             __A    :						Tuple						 =     0

     __A    :						int						 =     self.get_config()

     return config, input_ids, tf.convert_to_tensor(lowerCAmelCase__  )

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     return BlipTextConfig(
         vocab_size=self.vocab_size					,						hidden_size=self.hidden_size					,						projection_dim=self.projection_dim					,						num_hidden_layers=self.num_hidden_layers					,						num_attention_heads=self.num_attention_heads					,						intermediate_size=self.intermediate_size					,						dropout=self.dropout					,						attention_dropout=self.attention_dropout					,						max_position_embeddings=self.max_position_embeddings					,						initializer_range=self.initializer_range					,						bos_token_id=self.bos_token_id					,						)

 def 					UpperCamelCase__(    self					,						__lowerCamelCase					,						__lowerCamelCase					,						__lowerCamelCase  ):



     '''simple docstring'''




     __A    :						List[Any]						 =     TFBlipTextModel(config=lowerCAmelCase__  )
     __A    :						str						 =     model(lowerCAmelCase__					,						attention_mask=lowerCAmelCase__					,						training=lowerCAmelCase__  )
     __A    :						List[str]						 =     model(lowerCAmelCase__					,						training=lowerCAmelCase__  )
     self.parent.assertEqual(result.last_hidden_state.shape					,						(self.batch_size, self.seq_length, self.hidden_size)  )
     self.parent.assertEqual(result.pooler_output.shape					,						(self.batch_size, self.hidden_size)  )







 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     __A    :						Optional[Any]						 =     self.prepare_config_and_inputs()
     __A    :						Union[str, Any]						 =     config_and_inputs
     __A    :						List[Any]						 =     {'input_ids': input_ids, 'attention_mask': input_mask}
     return config, inputs_dict






@require_tf
class 		__snake_case					(		__UpperCamelCase							,							unittest.TestCase     ):





 """simple docstring"""


 _lowerCamelCase        =     (TFBlipTextModel,) if is_tf_available() else ()
 _lowerCamelCase        =     False
 _lowerCamelCase        =     False
 _lowerCamelCase        =     False

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     __A    :						int						 =     BlipTextModelTester(self  )
     __A    :						Union[str, Any]						 =     ConfigTester(self					,						config_class=lowerCAmelCase__					,						hidden_size=37  )

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     self.config_tester.run_common_tests()

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     __A    :						List[str]						 =     self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_model(*lowerCAmelCase__  )

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     pass

 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     pass

 @unittest.skip(reason='''Blip does not use inputs_embeds'''  )
 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     pass

 @unittest.skip(reason='''BlipTextModel has no base class and is not available in MODEL_MAPPING'''  )
 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     pass

 @unittest.skip(reason='''BlipTextModel has no base class and is not available in MODEL_MAPPING'''  )
 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     pass

 @slow
 def 					UpperCamelCase__(    self  ):



     '''simple docstring'''




     for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
         __A    :						Any						 =     TFBlipTextModel.from_pretrained(lowerCAmelCase__  )
         self.assertIsNotNone(lowerCAmelCase__  )







 def 					UpperCamelCase__(    self					,						__lowerCamelCase=True  ):



     '''simple docstring'''




     super().test_pt_tf_model_equivalence(allow_missing_keys=lowerCAmelCase__  )








def    snake_case_     (  snake_case     )  ->				int:
       if n == 1 or not isinstance(snake_case			,							snake_case     ):
              return 0
       elif n == 2:
              return 1
       else:
              lowercase__:   Optional[Any]  			=   [0, 1]
              for i in range(2			,							n + 1     ):
                     sequence.append(sequence[i - 1] + sequence[i - 2]     )

              return sequence[n]




def    snake_case_     (  snake_case     )  ->				int:
       lowercase__:   int  			=   0
       lowercase__:   int  			=   2

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

       return index




def    snake_case_     (  snake_case = 10_00     )  ->				int:
       return fibonacci_digits_index(snake_case     )


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


