import copy
import os
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Union


if TYPE_CHECKING:
      from ...processing_utils import ProcessorMixin
      from ...utils import TensorType

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A     :  Optional[int]					     =       logging.get_logger(__name__)

A     :  int					     =       {
    "google/owlvit-base-patch32": "https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json",
    "google/owlvit-base-patch16": "https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json",
    "google/owlvit-large-patch14": "https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json",
}


class   lowerCamelCase					(SCREAMING_SNAKE_CASE__					):
  """simple docstring"""







  lowerCamelCase__     =						'''owlvit_text_model'''







  def __init__(							self :       Union[str, Any]  ,     __magic_name__ :       Dict=49_408  ,     __magic_name__ :       List[str]=512  ,     __magic_name__ :       Dict=2_048  ,     __magic_name__ :       str=12  ,     __magic_name__ :       Dict=8  ,     __magic_name__ :       Optional[int]=16  ,     __magic_name__ :       Tuple="quick_gelu"  ,     __magic_name__ :       Dict=1e-5  ,     __magic_name__ :       str=0.0  ,     __magic_name__ :       Union[str, Any]=0.02  ,     __magic_name__ :       Dict=1.0  ,     __magic_name__ :       Optional[int]=0  ,     __magic_name__ :       Union[str, Any]=49_406  ,     __magic_name__ :       Optional[Any]=49_407  ,     **__magic_name__ :       Dict  ,     )  ->	Tuple:
        super().__init__(pad_token_id=__magic_name__  ,     bos_token_id=__magic_name__  ,     eos_token_id=__magic_name__  ,     **__magic_name__   )

        SCREAMING_SNAKE_CASE_          =  vocab_size
        SCREAMING_SNAKE_CASE_          =  hidden_size
        SCREAMING_SNAKE_CASE_          =  intermediate_size
        SCREAMING_SNAKE_CASE_          =  num_hidden_layers
        SCREAMING_SNAKE_CASE_          =  num_attention_heads
        SCREAMING_SNAKE_CASE_          =  max_position_embeddings
        SCREAMING_SNAKE_CASE_          =  hidden_act
        SCREAMING_SNAKE_CASE_          =  layer_norm_eps
        SCREAMING_SNAKE_CASE_          =  attention_dropout
        SCREAMING_SNAKE_CASE_          =  initializer_range
        SCREAMING_SNAKE_CASE_          =  initializer_factor







  @classmethod
  def    __A     (							cls :       int  ,     __magic_name__ :       Union[str, os.PathLike]  ,     **__magic_name__ :       int   )  ->	"PretrainedConfig":
        cls._set_token_in_kwargs(__magic_name__   )

        SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_          =  cls.get_config_dict(__magic_name__  ,     **__magic_name__   )

        # get the text config dict if we are loading from OwlViTConfig
        if config_dict.get("model_type"   ) == "owlvit":
              SCREAMING_SNAKE_CASE_          =  config_dict["text_config"]

        if "model_type" in config_dict and hasattr(cls  ,     "model_type"   ) and config_dict["model_type"] != cls.model_type:
              logger.warning(
                  F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
                  F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''   )

        return cls.from_dict(__magic_name__  ,     **__magic_name__   )



class   lowerCamelCase					(SCREAMING_SNAKE_CASE__					):
  """simple docstring"""







  lowerCamelCase__     =						'''owlvit_vision_model'''







  def __init__(							self :       Optional[Any]  ,     __magic_name__ :       str=768  ,     __magic_name__ :       Union[str, Any]=3_072  ,     __magic_name__ :       Optional[int]=12  ,     __magic_name__ :       str=12  ,     __magic_name__ :       Optional[int]=3  ,     __magic_name__ :       List[Any]=768  ,     __magic_name__ :       Any=32  ,     __magic_name__ :       Union[str, Any]="quick_gelu"  ,     __magic_name__ :       Optional[int]=1e-5  ,     __magic_name__ :       List[Any]=0.0  ,     __magic_name__ :       Optional[int]=0.02  ,     __magic_name__ :       Tuple=1.0  ,     **__magic_name__ :       int  ,     )  ->	List[str]:
        super().__init__(**__magic_name__   )

        SCREAMING_SNAKE_CASE_          =  hidden_size
        SCREAMING_SNAKE_CASE_          =  intermediate_size
        SCREAMING_SNAKE_CASE_          =  num_hidden_layers
        SCREAMING_SNAKE_CASE_          =  num_attention_heads
        SCREAMING_SNAKE_CASE_          =  num_channels
        SCREAMING_SNAKE_CASE_          =  image_size
        SCREAMING_SNAKE_CASE_          =  patch_size
        SCREAMING_SNAKE_CASE_          =  hidden_act
        SCREAMING_SNAKE_CASE_          =  layer_norm_eps
        SCREAMING_SNAKE_CASE_          =  attention_dropout
        SCREAMING_SNAKE_CASE_          =  initializer_range
        SCREAMING_SNAKE_CASE_          =  initializer_factor







  @classmethod
  def    __A     (							cls :       str  ,     __magic_name__ :       Union[str, os.PathLike]  ,     **__magic_name__ :       Optional[Any]   )  ->	"PretrainedConfig":
        cls._set_token_in_kwargs(__magic_name__   )

        SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_          =  cls.get_config_dict(__magic_name__  ,     **__magic_name__   )

        # get the vision config dict if we are loading from OwlViTConfig
        if config_dict.get("model_type"   ) == "owlvit":
              SCREAMING_SNAKE_CASE_          =  config_dict["vision_config"]

        if "model_type" in config_dict and hasattr(cls  ,     "model_type"   ) and config_dict["model_type"] != cls.model_type:
              logger.warning(
                  F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
                  F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''   )

        return cls.from_dict(__magic_name__  ,     **__magic_name__   )



class   lowerCamelCase					(SCREAMING_SNAKE_CASE__					):
  """simple docstring"""







  lowerCamelCase__     =						'''owlvit'''
  lowerCamelCase__     =						True







  def __init__(							self :       List[str]  ,     __magic_name__ :       int=None  ,     __magic_name__ :       Tuple=None  ,     __magic_name__ :       List[Any]=512  ,     __magic_name__ :       str=2.6592  ,     __magic_name__ :       Union[str, Any]=True  ,     **__magic_name__ :       int  ,     )  ->	List[Any]:
        super().__init__(**__magic_name__   )

        if text_config is None:
              SCREAMING_SNAKE_CASE_          =  {}
              logger.info("text_config is None. Initializing the OwlViTTextConfig with default values."   )

        if vision_config is None:
              SCREAMING_SNAKE_CASE_          =  {}
              logger.info("vision_config is None. initializing the OwlViTVisionConfig with default values."   )

        SCREAMING_SNAKE_CASE_          =  OwlViTTextConfig(**__magic_name__   )
        SCREAMING_SNAKE_CASE_          =  OwlViTVisionConfig(**__magic_name__   )

        SCREAMING_SNAKE_CASE_          =  projection_dim
        SCREAMING_SNAKE_CASE_          =  logit_scale_init_value
        SCREAMING_SNAKE_CASE_          =  return_dict
        SCREAMING_SNAKE_CASE_          =  1.0







  @classmethod
  def    __A     (							cls :       Any  ,     __magic_name__ :       Union[str, os.PathLike]  ,     **__magic_name__ :       List[str]   )  ->	"PretrainedConfig":
        cls._set_token_in_kwargs(__magic_name__   )

        SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_          =  cls.get_config_dict(__magic_name__  ,     **__magic_name__   )

        if "model_type" in config_dict and hasattr(cls  ,     "model_type"   ) and config_dict["model_type"] != cls.model_type:
              logger.warning(
                  F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
                  F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''   )

        return cls.from_dict(__magic_name__  ,     **__magic_name__   )







  @classmethod
  def    __A     (							cls :       List[Any]  ,     __magic_name__ :       Dict  ,     __magic_name__ :       Dict  ,     **__magic_name__ :       List[str]   )  ->	List[str]:
        SCREAMING_SNAKE_CASE_          =  {}
        SCREAMING_SNAKE_CASE_          =  text_config
        SCREAMING_SNAKE_CASE_          =  vision_config

        return cls.from_dict(__magic_name__  ,     **__magic_name__   )







  def    __A     (							self :       Optional[Any]   )  ->	str:
        SCREAMING_SNAKE_CASE_          =  copy.deepcopy(self.__dict__   )
        SCREAMING_SNAKE_CASE_          =  self.text_config.to_dict()
        SCREAMING_SNAKE_CASE_          =  self.vision_config.to_dict()
        SCREAMING_SNAKE_CASE_          =  self.__class__.model_type
        return output



class   lowerCamelCase					(SCREAMING_SNAKE_CASE__					):
  """simple docstring"""







  @property
  def    __A     (							self :       Any   )  ->	Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ("input_ids", {0: "batch", 1: "sequence"}),
                ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
                ("attention_mask", {0: "batch", 1: "sequence"}),
            ]   )







  @property
  def    __A     (							self :       int   )  ->	Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ("logits_per_image", {0: "batch"}),
                ("logits_per_text", {0: "batch"}),
                ("text_embeds", {0: "batch"}),
                ("image_embeds", {0: "batch"}),
            ]   )







  @property
  def    __A     (							self :       str   )  ->	float:
        return 1e-4







  def    __A     (							self :       str  ,     __magic_name__ :       "ProcessorMixin"  ,     __magic_name__ :       int = -1  ,     __magic_name__ :       int = -1  ,     __magic_name__ :       Optional["TensorType"] = None  ,     )  ->	Mapping[str, Any]:
        SCREAMING_SNAKE_CASE_          =  super().generate_dummy_inputs(
            processor.tokenizer  ,     batch_size=__magic_name__  ,     seq_length=__magic_name__  ,     framework=__magic_name__   )
        SCREAMING_SNAKE_CASE_          =  super().generate_dummy_inputs(
            processor.image_processor  ,     batch_size=__magic_name__  ,     framework=__magic_name__   )
        return {**text_input_dict, **image_input_dict}







  @property
  def    __A     (							self :       Optional[int]   )  ->	int:
        return 14



from __future__ import annotations


def      a__ (		__UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  str(__UpperCamelCase				)
      return n == n[::-1]


def      a__ (		__UpperCamelCase = 1_0_0_0_0_0_0				):
      SCREAMING_SNAKE_CASE_          =  0

      for i in range(1     ,      __UpperCamelCase				):
            if is_palindrome(__UpperCamelCase				) and is_palindrome(bin(__UpperCamelCase				).split("b"				)[1]				):
                  total += i
      return total


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


