

'''simple docstring'''

from __future__ import annotations

import unittest

from transformers import MobileBertConfig, is_tf_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_tf, slow

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


if is_tf_available():
       import tensorflow as tf

       from transformers import (
           TF_MODEL_FOR_PRETRAINING_MAPPING,
           TFMobileBertForMaskedLM,
           TFMobileBertForMultipleChoice,
           TFMobileBertForNextSentencePrediction,
           TFMobileBertForPreTraining,
           TFMobileBertForQuestionAnswering,
           TFMobileBertForSequenceClassification,
           TFMobileBertForTokenClassification,
           TFMobileBertModel,
       )


@require_tf
class 	lowerCAmelCase  (   A ,      A ,      unittest.TestCase ):
       lowerCAmelCase_												=			(
           (
               TFMobileBertModel,
               TFMobileBertForMaskedLM,
               TFMobileBertForNextSentencePrediction,
               TFMobileBertForPreTraining,
               TFMobileBertForQuestionAnswering,
               TFMobileBertForSequenceClassification,
               TFMobileBertForTokenClassification,
               TFMobileBertForMultipleChoice,
           )
           if is_tf_available()
           else ()
       )
       lowerCAmelCase_												=			(
           {
               "feature-extraction": TFMobileBertModel,
               "fill-mask": TFMobileBertForMaskedLM,
               "question-answering": TFMobileBertForQuestionAnswering,
               "text-classification": TFMobileBertForSequenceClassification,
               "token-classification": TFMobileBertForTokenClassification,
               "zero-shot": TFMobileBertForSequenceClassification,
           }
           if is_tf_available()
           else {}
       )
       lowerCAmelCase_												=			False
       lowerCAmelCase_												=			False







       def       snake_case (				self      :			List[Any]    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			List[Any]    ,   __lowercase      :			List[str]=False   ):







            """simple docstring"""







            __lowercase      		=super()._prepare_for_class(__lowercase    ,   __lowercase    ,   return_labels=__lowercase   )

            if return_labels:
                 if model_class in get_values(__lowercase   ):
                      __lowercase      		=tf.zeros(self.model_tester.batch_size    ,   dtype=tf.intaa   )

            return inputs_dict


       class 	lowerCAmelCase  (   A ):







              def __init__(				self      :			Optional[Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			Optional[int]=13    ,   __lowercase      :			str=7    ,   __lowercase      :			List[Any]=True    ,   __lowercase      :			Optional[Any]=True    ,   __lowercase      :			Union[str, Any]=True    ,   __lowercase      :			List[str]=True    ,   __lowercase      :			Tuple=99    ,   __lowercase      :			Any=32    ,   __lowercase      :			Dict=32    ,   __lowercase      :			int=2    ,   __lowercase      :			Tuple=4    ,   __lowercase      :			List[str]=37    ,   __lowercase      :			Optional[Any]="gelu"    ,   __lowercase      :			str=0.1    ,   __lowercase      :			Tuple=0.1    ,   __lowercase      :			List[str]=512    ,   __lowercase      :			List[str]=16    ,   __lowercase      :			List[Any]=2    ,   __lowercase      :			Tuple=0.0_2    ,   __lowercase      :			int=3    ,   __lowercase      :			Optional[int]=4    ,   __lowercase      :			str=None    ,   ):







                   """simple docstring"""







                   __lowercase      		=parent
                   __lowercase      		=batch_size
                   __lowercase      		=seq_length
                   __lowercase      		=is_training
                   __lowercase      		=use_input_mask
                   __lowercase      		=use_token_type_ids
                   __lowercase      		=use_labels
                   __lowercase      		=vocab_size
                   __lowercase      		=hidden_size
                   __lowercase      		=num_hidden_layers
                   __lowercase      		=num_attention_heads
                   __lowercase      		=intermediate_size
                   __lowercase      		=hidden_act
                   __lowercase      		=hidden_dropout_prob
                   __lowercase      		=attention_probs_dropout_prob
                   __lowercase      		=max_position_embeddings
                   __lowercase      		=type_vocab_size
                   __lowercase      		=type_sequence_label_size
                   __lowercase      		=initializer_range
                   __lowercase      		=num_labels
                   __lowercase      		=num_choices
                   __lowercase      		=scope
                   __lowercase      		=embedding_size







              def       snake_case (				self      :			List[Any]   ):







                   """simple docstring"""







                   __lowercase      		=ids_tensor([self.batch_size, self.seq_length]    ,   self.vocab_size   )

                   __lowercase      		=None
                   if self.use_input_mask:
                        __lowercase      		=random_attention_mask([self.batch_size, self.seq_length]   )

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

                   __lowercase      		=None
                   __lowercase      		=None
                   __lowercase      		=None
                   if self.use_labels:
                        __lowercase      		=ids_tensor([self.batch_size]    ,   self.type_sequence_label_size   )
                        __lowercase      		=ids_tensor([self.batch_size, self.seq_length]    ,   self.num_labels   )
                        __lowercase      		=ids_tensor([self.batch_size]    ,   self.num_choices   )

                   __lowercase      		=MobileBertConfig(
                       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    ,   initializer_range=self.initializer_range    ,   embedding_size=self.embedding_size    ,   )

                   return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







              def       snake_case (				self      :			Optional[int]    ,   __lowercase      :			Tuple    ,   __lowercase      :			Tuple    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			Dict   ):







                   """simple docstring"""







                   __lowercase      		=TFMobileBertModel(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )

                   __lowercase      		=[input_ids, input_mask]
                   __lowercase      		=model(__lowercase   )

                   __lowercase      		=model(__lowercase   )

                   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       snake_case (				self      :			Dict    ,   __lowercase      :			Tuple    ,   __lowercase      :			Any    ,   __lowercase      :			List[Any]    ,   __lowercase      :			Union[str, Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			Any    ,   __lowercase      :			Any   ):







                   """simple docstring"""







                   __lowercase      		=TFMobileBertForMaskedLM(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.seq_length, self.vocab_size)   )







              def       snake_case (				self      :			List[str]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			str    ,   __lowercase      :			List[str]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			Any   ):







                   """simple docstring"""







                   __lowercase      		=TFMobileBertForNextSentencePrediction(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, 2)   )







              def       snake_case (				self      :			List[str]    ,   __lowercase      :			Any    ,   __lowercase      :			Tuple    ,   __lowercase      :			Dict    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[Any]   ):







                   """simple docstring"""







                   __lowercase      		=TFMobileBertForPreTraining(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(
                       result.prediction_logits.shape    ,   (self.batch_size, self.seq_length, self.vocab_size)   )
                   self.parent.assertEqual(result.seq_relationship_logits.shape    ,   (self.batch_size, 2)   )







              def       snake_case (				self      :			Optional[int]    ,   __lowercase      :			str    ,   __lowercase      :			List[Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			Dict    ,   __lowercase      :			List[str]    ,   __lowercase      :			Optional[Any]   ):







                   """simple docstring"""







                   __lowercase      		=self.num_labels
                   __lowercase      		=TFMobileBertForSequenceClassification(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.num_labels)   )







              def       snake_case (				self      :			List[str]    ,   __lowercase      :			str    ,   __lowercase      :			Dict    ,   __lowercase      :			Union[str, Any]    ,   __lowercase      :			Union[str, Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			Dict   ):







                   """simple docstring"""







                   __lowercase      		=self.num_choices
                   __lowercase      		=TFMobileBertForMultipleChoice(config=__lowercase   )
                   __lowercase      		=tf.tile(tf.expand_dims(__lowercase    ,   1   )    ,   (1, self.num_choices, 1)   )
                   __lowercase      		=tf.tile(tf.expand_dims(__lowercase    ,   1   )    ,   (1, self.num_choices, 1)   )
                   __lowercase      		=tf.tile(tf.expand_dims(__lowercase    ,   1   )    ,   (1, self.num_choices, 1)   )
                   __lowercase      		={
                       'input_ids': multiple_choice_inputs_ids,
                       'attention_mask': multiple_choice_input_mask,
                       'token_type_ids': multiple_choice_token_type_ids,
                   }
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.num_choices)   )







              def       snake_case (				self      :			str    ,   __lowercase      :			Any    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			Optional[Any]    ,   __lowercase      :			List[str]    ,   __lowercase      :			int    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			Optional[int]   ):







                   """simple docstring"""







                   __lowercase      		=self.num_labels
                   __lowercase      		=TFMobileBertForTokenClassification(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.logits.shape    ,   (self.batch_size, self.seq_length, self.num_labels)   )







              def       snake_case (				self      :			str    ,   __lowercase      :			List[str]    ,   __lowercase      :			Union[str, Any]    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			Any    ,   __lowercase      :			int    ,   __lowercase      :			Optional[int]    ,   __lowercase      :			str   ):







                   """simple docstring"""







                   __lowercase      		=TFMobileBertForQuestionAnswering(config=__lowercase   )
                   __lowercase      		={'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
                   __lowercase      		=model(__lowercase   )
                   self.parent.assertEqual(result.start_logits.shape    ,   (self.batch_size, self.seq_length)   )
                   self.parent.assertEqual(result.end_logits.shape    ,   (self.batch_size, self.seq_length)   )







              def       snake_case (				self      :			str   ):







                   """simple docstring"""







                   __lowercase      		=self.prepare_config_and_inputs()
                   (
                       (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  (
                       __lowercase
                   )		,  
                   )      		=config_and_inputs
                   __lowercase      		={'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
                   return config, inputs_dict







       def       snake_case (				self      :			List[Any]   ):







            """simple docstring"""







            __lowercase      		=TFMobileBertModelTest.TFMobileBertModelTester(self   )
            __lowercase      		=ConfigTester(self    ,   config_class=__lowercase    ,   hidden_size=37   )







       def       snake_case (				self      :			List[str]   ):







            """simple docstring"""







            self.config_tester.run_common_tests()







       def       snake_case (				self      :			Any   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_model(*__lowercase   )







       def       snake_case (				self      :			List[Any]   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_masked_lm(*__lowercase   )







       def       snake_case (				self      :			Tuple   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_multiple_choice(*__lowercase   )







       def       snake_case (				self      :			str   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_next_sequence_prediction(*__lowercase   )







       def       snake_case (				self      :			Any   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_pretraining(*__lowercase   )







       def       snake_case (				self      :			Any   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_question_answering(*__lowercase   )







       def       snake_case (				self      :			Dict   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_sequence_classification(*__lowercase   )







       def       snake_case (				self      :			Optional[Any]   ):







            """simple docstring"""







            __lowercase      		=self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_mobilebert_for_token_classification(*__lowercase   )







       @slow
       def       snake_case (				self      :			List[str]   ):







            """simple docstring"""







            for model_name in ["google/mobilebert-uncased"]:
                 __lowercase      		=TFMobileBertModel.from_pretrained(__lowercase   )
                 self.assertIsNotNone(__lowercase   )






@require_tf
class 	lowerCAmelCase  (   unittest.TestCase ):







       @slow
       def       snake_case (				self      :			int   ):







            """simple docstring"""







            __lowercase      		=TFMobileBertForPreTraining.from_pretrained('google/mobilebert-uncased'   )
            __lowercase      		=tf.constant([[0, 1, 2, 3, 4, 5]]   )
            __lowercase      		=model(__lowercase   )[0]

            __lowercase      		=[1, 6, 30522]
            self.assertEqual(output.shape    ,   __lowercase   )

            __lowercase      		=tf.constant(
                [
                    [
                        [-4.5_9_1_9_5_4_7, -9.2_4_8_2_9_5, -9.6_4_5_2_5_6],
                        [-6.7_3_0_6_1_7_5, -6.4_4_0_2_8_4, -6.6_0_5_2_8_3_7],
                        [-7.2_7_4_3_5_0_6, -6.7_8_4_7_9_1_5, -6.0_2_4_6_7_3],
                    ]
                ]   )
            tf.debugging.assert_near(output[:, :3, :3]    ,   __lowercase    ,   atol=1E-4   )





'''simple docstring'''

def 					__UpperCamelCase				(						lowercase__    :	int			):






     '''simple docstring'''





     if n == 1 or not isinstance(lowercase__,       lowercase__			):
          return 0
     elif n == 2:
          return 1
     else:
          __lowercase      		=[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      		=0
     __lowercase      		=2

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

     return index

def 					__UpperCamelCase				(						lowercase__    :	int = 10_00			):






     '''simple docstring'''





     return fibonacci_digits_index(lowercase__			)


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


