'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowerCAmelCase_ : Optional[Any]						  =      logging.get_logger(__name__)

lowerCAmelCase_ : Tuple						  =      {
    "microsoft/table-transformer-detection": (
        "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json"
    ),
}





class 							lowercase						(						__lowerCamelCase ):
   lowerCamelCase_    					='table-transformer'
   lowerCamelCase_    					=['past_key_values']
   lowerCamelCase_    					={
       'hidden_size': 'd_model',
       'num_attention_heads': 'encoder_attention_heads',
   }


   def __init__(   self				:	List[str]   ,		__lowerCAmelCase				:	Optional[Any]=True   ,		__lowerCAmelCase				:	Union[str, Any]=None   ,		__lowerCAmelCase				:	str=3   ,		__lowerCAmelCase				:	Tuple=100   ,		__lowerCAmelCase				:	Optional[int]=6   ,		__lowerCAmelCase				:	List[str]=2048   ,		__lowerCAmelCase				:	Union[str, Any]=8   ,		__lowerCAmelCase				:	Tuple=6   ,		__lowerCAmelCase				:	Union[str, Any]=2048   ,		__lowerCAmelCase				:	Optional[int]=8   ,		__lowerCAmelCase				:	Optional[Any]=0.0   ,		__lowerCAmelCase				:	Optional[int]=0.0   ,		__lowerCAmelCase				:	Dict=True   ,		__lowerCAmelCase				:	Dict="relu"   ,		__lowerCAmelCase				:	Union[str, Any]=256   ,		__lowerCAmelCase				:	Tuple=0.1   ,		__lowerCAmelCase				:	Any=0.0   ,		__lowerCAmelCase				:	Tuple=0.0   ,		__lowerCAmelCase				:	str=0.02   ,		__lowerCAmelCase				:	str=1.0   ,		__lowerCAmelCase				:	Any=False   ,		__lowerCAmelCase				:	Union[str, Any]="sine"   ,		__lowerCAmelCase				:	List[Any]="resnet50"   ,		__lowerCAmelCase				:	Optional[Any]=True   ,		__lowerCAmelCase				:	Union[str, Any]=False   ,		__lowerCAmelCase				:	Optional[int]=1   ,		__lowerCAmelCase				:	Tuple=5   ,		__lowerCAmelCase				:	Dict=2   ,		__lowerCAmelCase				:	List[str]=1   ,		__lowerCAmelCase				:	List[str]=1   ,		__lowerCAmelCase				:	List[str]=5   ,		__lowerCAmelCase				:	List[str]=2   ,		__lowerCAmelCase				:	int=0.1   ,		**__lowerCAmelCase				:	Any   ,		)      ->					Any:
         if backbone_config is not None and use_timm_backbone:
               raise ValueError("You can't specify both `backbone_config` and `use_timm_backbone`.")

         if not use_timm_backbone:
               if backbone_config is None:
                     logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.")
                     lowercase_     =      CONFIG_MAPPING["resnet"](out_features=["stage4"])
               elif isinstance(__lowerCAmelCase   ,		__lowerCAmelCase):
                     lowercase_     =      backbone_config.get("model_type")
                     lowercase_     =      CONFIG_MAPPING[backbone_model_type]
                     lowercase_     =      config_class.from_dict(__lowerCAmelCase)
               # set timm attributes to None
               lowercase_ ,							lowercase_ ,							lowercase_     =      None, None, None

         lowercase_     =      use_timm_backbone
         lowercase_     =      backbone_config
         lowercase_     =      num_channels
         lowercase_     =      num_queries
         lowercase_     =      d_model
         lowercase_     =      encoder_ffn_dim
         lowercase_     =      encoder_layers
         lowercase_     =      encoder_attention_heads
         lowercase_     =      decoder_ffn_dim
         lowercase_     =      decoder_layers
         lowercase_     =      decoder_attention_heads
         lowercase_     =      dropout
         lowercase_     =      attention_dropout
         lowercase_     =      activation_dropout
         lowercase_     =      activation_function
         lowercase_     =      init_std
         lowercase_     =      init_xavier_std
         lowercase_     =      encoder_layerdrop
         lowercase_     =      decoder_layerdrop
         lowercase_     =      encoder_layers
         lowercase_     =      auxiliary_loss
         lowercase_     =      position_embedding_type
         lowercase_     =      backbone
         lowercase_     =      use_pretrained_backbone
         lowercase_     =      dilation
         # Hungarian matcher
         lowercase_     =      class_cost
         lowercase_     =      bbox_cost
         lowercase_     =      giou_cost
         # Loss coefficients
         lowercase_     =      mask_loss_coefficient
         lowercase_     =      dice_loss_coefficient
         lowercase_     =      bbox_loss_coefficient
         lowercase_     =      giou_loss_coefficient
         lowercase_     =      eos_coefficient
         super().__init__(is_encoder_decoder=__lowerCAmelCase   ,		**__lowerCAmelCase)


   @property
   def __UpperCAmelCase       (   self				:	Any)      ->					int:
         return self.encoder_attention_heads


   @property
   def __UpperCAmelCase       (   self				:	Union[str, Any])      ->					int:
         return self.d_model





class 							lowercase						(						__lowerCamelCase ):
   lowerCamelCase_    					=version.parse('1.11' )


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


   @property
   def __UpperCAmelCase       (   self				:	Union[str, Any])      ->					float:
         return 1e-5


   @property
   def __UpperCAmelCase       (   self				:	int)      ->					int:
         return 12







'''simple docstring'''

from __future__ import annotations


def __a (	__lowerCamelCase			:						int | str				)	->							bool:
      '''simple docstring'''


      lowercase_     =      str(__lowerCamelCase				)
      return n == n[::-1]


def __a (	__lowerCamelCase			:						int = 1_000_000				)	->							Optional[int]:
      '''simple docstring'''


      lowercase_     =      0

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


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






