import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel





class 							lowercase						(						a__ ):
   lowerCamelCase_    					="""M-CLIP"""


   def __init__(   self				:	List[Any]   ,		__lowerCAmelCase				:	Tuple=1024   ,		__lowerCAmelCase				:	Dict=768   ,		**__lowerCAmelCase				:	Optional[Any])      ->					Optional[Any]:
         lowercase_     =      transformerDimSize
         lowercase_     =      imageDimSize
         super().__init__(**lowerCAmelCase__)





class 							lowercase						(						a__ ):
   lowerCamelCase_    					=MCLIPConfig


   def __init__(   self				:	Optional[int]   ,		__lowerCAmelCase				:	Dict   ,		*__lowerCAmelCase				:	Optional[Any]   ,		**__lowerCAmelCase				:	int)      ->					Union[str, Any]:
         super().__init__(lowerCAmelCase__   ,		*lowerCAmelCase__   ,		**lowerCAmelCase__)
         lowercase_     =      XLMRobertaModel(lowerCAmelCase__)
         lowercase_     =      torch.nn.Linear(
             in_features=config.transformerDimensions   ,		out_features=config.numDims)


   def __UpperCAmelCase       (   self				:	List[str]   ,		__lowerCAmelCase				:	Union[str, Any]   ,		__lowerCAmelCase				:	Tuple)      ->					str:
         lowercase_     =      self.transformer(input_ids=lowerCAmelCase__   ,		attention_mask=lowerCAmelCase__)[0]
         lowercase_     =      (embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
         return self.LinearTransformation(lowerCAmelCase__), embs







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






