

import unittest

import numpy as np

from transformers import ElectraConfig, 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():
   from transformers.models.electra.modeling_flax_electra import (
       FlaxElectraForCausalLM,
       FlaxElectraForMaskedLM,
       FlaxElectraForMultipleChoice,
       FlaxElectraForPreTraining,
       FlaxElectraForQuestionAnswering,
       FlaxElectraForSequenceClassification,
       FlaxElectraForTokenClassification,
       FlaxElectraModel,
   )



class        _UpperCAmelCase (   unittest.TestCase			):
  '''simple docstring'''







  def __init__( self	: int		,						UpperCamelCase__	: List[str]		,						UpperCamelCase__	: Optional[int]=13		,						UpperCamelCase__	: int=7		,						UpperCamelCase__	: List[Any]=True		,						UpperCamelCase__	: Optional[int]=True		,						UpperCamelCase__	: Tuple=True		,						UpperCamelCase__	: Optional[Any]=True		,						UpperCamelCase__	: Optional[Any]=99		,						UpperCamelCase__	: Union[str, Any]=24		,						UpperCamelCase__	: List[str]=32		,						UpperCamelCase__	: List[str]=5		,						UpperCamelCase__	: int=4		,						UpperCamelCase__	: str=37		,						UpperCamelCase__	: str="gelu"		,						UpperCamelCase__	: List[str]=0.1		,						UpperCamelCase__	: Optional[int]=0.1		,						UpperCamelCase__	: Tuple=512		,						UpperCamelCase__	: Optional[Any]=16		,						UpperCamelCase__	: Optional[int]=2		,						UpperCamelCase__	: str=0.02		,						UpperCamelCase__	: Tuple=4		,						):
        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    =				embedding_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	: Tuple ):
        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    =				ElectraConfig(
            vocab_size=self.vocab_size		,						hidden_size=self.hidden_size		,						embedding_size=self.embedding_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		,						)

        return config, input_ids, token_type_ids, attention_mask







  def 	UpperCamelCase       ( self	: int ):
        A    =				self.prepare_config_and_inputs()
        A ,	A ,	A ,	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        _UpperCAmelCase (   __lowercase     ,				unittest.TestCase			):
  '''simple docstring'''







  SCREAMING_SNAKE_CASE							:				Dict					      =				True

  SCREAMING_SNAKE_CASE							:				Optional[Any]					      =				(
      (
          FlaxElectraModel,
          FlaxElectraForCausalLM,
          FlaxElectraForMaskedLM,
          FlaxElectraForPreTraining,
          FlaxElectraForTokenClassification,
          FlaxElectraForQuestionAnswering,
          FlaxElectraForMultipleChoice,
          FlaxElectraForSequenceClassification,
      )
      if is_flax_available()
      else ()
  )







  def 	UpperCamelCase       ( self	: str ):
        A    =				FlaxElectraModelTester(self )







  @slow
  def 	UpperCamelCase       ( self	: Dict ):
        for model_class_name in self.all_model_classes:
              if model_class_name == FlaxElectraForMaskedLM:
                    A    =				model_class_name.from_pretrained('google/electra-small-generator' )
              else:
                    A    =				model_class_name.from_pretrained('google/electra-small-discriminator' )
              A    =				model(np.ones((1, 1) ) )
              self.assertIsNotNone(UpperCamelCase__ )






from math import floor, sqrt


def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  int:
      A    =				0.0
      A    =				1.0
      A    =				int(sqrt(lowerCAmelCase     )     )
      A    =				root
      A    =				0
      while integer_part != 2 * root:
            A    =				denominator * integer_part - numerator
            A    =				(n - numerator**2) / denominator
            A    =				int((root + numerator) / denominator     )
            period += 1
      return period


def 			__UpperCamelCase    (lowerCAmelCase					:  int = 10_000     )     ->  int:
      A    =				0
      for i in range(2,    n + 1     ):
            A    =				sqrt(lowerCAmelCase     )
            if sr - floor(lowerCAmelCase     ) != 0 and continuous_fraction_period(lowerCAmelCase     ) % 2 == 1:
                  count_odd_periods += 1
      return count_odd_periods


if __name__ == "__main__":
  print(F'''{solution(int(input().strip()))}''')



