



'''simple docstring'''


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase											=      logging.get_logger(__name__)

lowercase											=      {
    '''facebook/sam-vit-huge''': '''https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json''',
    '''facebook/sam-vit-large''': '''https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json''',
    '''facebook/sam-vit-base''': '''https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json''',
}







class 						UpperCAmelCase						(		__a):


 '''simple docstring'''




 def __init__( self				,	lowerCAmelCase_=2_5_6				,	lowerCAmelCase_=1_0_2_4				,	lowerCAmelCase_=1_6				,	lowerCAmelCase_=1_6				,	lowerCAmelCase_=4				,	lowerCAmelCase_="gelu"				,	lowerCAmelCase_=1e-6				,	**lowerCAmelCase_				,	)			->   str:



      """simple docstring"""







      super().__init__(**lowerCAmelCase_)
      a_									=hidden_size
      a_									=image_size
      a_									=patch_size
      a_									=image_size // patch_size
      a_									=mask_input_channels
      a_									=num_point_embeddings
      a_									=hidden_act
      a_									=layer_norm_eps







class 						UpperCAmelCase						(		__a):


 '''simple docstring'''




 def __init__( self				,	lowerCAmelCase_=2_5_6				,	lowerCAmelCase_="relu"				,	lowerCAmelCase_=2_0_4_8				,	lowerCAmelCase_=2				,	lowerCAmelCase_=8				,	lowerCAmelCase_=2				,	lowerCAmelCase_=3				,	lowerCAmelCase_=3				,	lowerCAmelCase_=2_5_6				,	lowerCAmelCase_=1e-6				,	**lowerCAmelCase_				,	)			->   List[Any]:



      """simple docstring"""







      super().__init__(**lowerCAmelCase_)
      a_									=hidden_size
      a_									=hidden_act
      a_									=mlp_dim
      a_									=num_hidden_layers
      a_									=num_attention_heads
      a_									=attention_downsample_rate
      a_									=num_multimask_outputs
      a_									=iou_head_depth
      a_									=iou_head_hidden_dim
      a_									=layer_norm_eps







class 						UpperCAmelCase						(		__a):


 '''simple docstring'''




 def __init__( self				,	lowerCAmelCase_=7_6_8				,	lowerCAmelCase_=2_5_6				,	lowerCAmelCase_=1_2				,	lowerCAmelCase_=1_2				,	lowerCAmelCase_=3				,	lowerCAmelCase_=1_0_2_4				,	lowerCAmelCase_=1_6				,	lowerCAmelCase_="gelu"				,	lowerCAmelCase_=1e-06				,	lowerCAmelCase_=0.0				,	lowerCAmelCase_=1e-10				,	lowerCAmelCase_=True				,	lowerCAmelCase_=4.0				,	lowerCAmelCase_=True				,	lowerCAmelCase_=True				,	lowerCAmelCase_=1_4				,	lowerCAmelCase_=[2, 5, 8, 1_1]				,	lowerCAmelCase_=1_2_8				,	lowerCAmelCase_=None				,	**lowerCAmelCase_				,	)			->   Optional[Any]:



      """simple docstring"""







      super().__init__(**lowerCAmelCase_)

      a_									=hidden_size
      a_									=output_channels
      a_									=num_hidden_layers
      a_									=num_attention_heads
      a_									=num_channels
      a_									=image_size
      a_									=patch_size
      a_									=hidden_act
      a_									=layer_norm_eps
      a_									=attention_dropout
      a_									=initializer_range
      a_									=qkv_bias
      a_									=mlp_ratio
      a_									=use_abs_pos
      a_									=use_rel_pos
      a_									=window_size
      a_									=global_attn_indexes
      a_									=num_pos_feats
      a_									=int(hidden_size * mlp_ratio) if mlp_dim is None else mlp_dim







class 						UpperCAmelCase						(		__a):


 '''simple docstring'''




 __magic_name__       :			List[Any]	=   "sam"
 __magic_name__       :			List[str]	=   True




 def __init__( self				,	lowerCAmelCase_=None				,	lowerCAmelCase_=None				,	lowerCAmelCase_=None				,	lowerCAmelCase_=0.0_2				,	**lowerCAmelCase_				,	)			->   Optional[int]:



      """simple docstring"""







      super().__init__(**lowerCAmelCase_)
      a_									=vision_config if vision_config is not None else {}
      a_									=prompt_encoder_config if prompt_encoder_config is not None else {}
      a_									=mask_decoder_config if mask_decoder_config is not None else {}

      if isinstance(lowerCAmelCase_				,	lowerCAmelCase_):
           a_									=vision_config.to_dict()
      if isinstance(lowerCAmelCase_				,	lowerCAmelCase_):
           a_									=prompt_encoder_config.to_dict()
      if isinstance(lowerCAmelCase_				,	lowerCAmelCase_):
           a_									=mask_decoder_config.to_dict()

      a_									=SamVisionConfig(**lowerCAmelCase_)
      a_									=SamPromptEncoderConfig(**lowerCAmelCase_)
      a_									=SamMaskDecoderConfig(**lowerCAmelCase_)
      a_									=initializer_range




 def    lowercase_	( self)			->   Tuple:



      """simple docstring"""







      a_									=copy.deepcopy(self.__dict__)
      a_									=self.vision_config.to_dict()
      a_									=self.prompt_encoder_config.to_dict()
      a_									=self.mask_decoder_config.to_dict()
      a_									=self.__class__.model_type
      return output







'''simple docstring'''


from math import floor, sqrt






def 			UpperCAmelCase_							(		lowercase__							):


     '''simple docstring'''







     a_									=0.0
     a_									=1.0
     a_									=int(sqrt(lowercase__							)							)
     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_							(		lowercase__ = 1_0_0_0_0							):


     '''simple docstring'''







     a_									=0
     for i in range(2							,						n + 1							):
          a_									=sqrt(lowercase__							)
          if sr - floor(lowercase__							) != 0 and continuous_fraction_period(lowercase__							) % 2 == 1:
               count_odd_periods += 1
     return count_odd_periods


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


