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


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

lowerCAmelCase_ : Any						  =      {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/config.json"}





class 							lowercase						(						__A ):
   lowerCamelCase_    					="""openai-gpt"""
   lowerCamelCase_    					={
       """max_position_embeddings""": """n_positions""",
       """hidden_size""": """n_embd""",
       """num_attention_heads""": """n_head""",
       """num_hidden_layers""": """n_layer""",
   }


   def __init__(   self				:	List[str]   ,		__lowerCAmelCase				:	int=4_0478   ,		__lowerCAmelCase				:	Dict=512   ,		__lowerCAmelCase				:	Optional[int]=768   ,		__lowerCAmelCase				:	str=12   ,		__lowerCAmelCase				:	Any=12   ,		__lowerCAmelCase				:	Optional[Any]="gelu"   ,		__lowerCAmelCase				:	List[Any]=0.1   ,		__lowerCAmelCase				:	Union[str, Any]=0.1   ,		__lowerCAmelCase				:	int=0.1   ,		__lowerCAmelCase				:	Tuple=1e-5   ,		__lowerCAmelCase				:	int=0.02   ,		__lowerCAmelCase				:	Tuple="cls_index"   ,		__lowerCAmelCase				:	List[str]=True   ,		__lowerCAmelCase				:	Dict=None   ,		__lowerCAmelCase				:	List[Any]=True   ,		__lowerCAmelCase				:	str=0.1   ,		**__lowerCAmelCase				:	int   ,		)      ->					str:
         lowercase_     =      vocab_size
         lowercase_     =      n_positions
         lowercase_     =      n_embd
         lowercase_     =      n_layer
         lowercase_     =      n_head
         lowercase_     =      afn
         lowercase_     =      resid_pdrop
         lowercase_     =      embd_pdrop
         lowercase_     =      attn_pdrop
         lowercase_     =      layer_norm_epsilon
         lowercase_     =      initializer_range
         lowercase_     =      summary_type
         lowercase_     =      summary_use_proj
         lowercase_     =      summary_activation
         lowercase_     =      summary_first_dropout
         lowercase_     =      summary_proj_to_labels
         super().__init__(**UpperCamelCase__)







'''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()))))






