'''simple docstring'''





import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
      from .tokenization_camembert import CamembertTokenizer
else:
      A     :  Any					     =       None


A     :  Any					     =       logging.get_logger(__name__)

A     :  int					     =       {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"}

A     :  Any					     =       {
    "vocab_file": {
        "camembert-base": "https://huggingface.co/camembert-base/resolve/main/sentencepiece.bpe.model",
    },
    "tokenizer_file": {
        "camembert-base": "https://huggingface.co/camembert-base/resolve/main/tokenizer.json",
    },
}

A     :  List[Any]					     =       {
    "camembert-base": 5_12,
}

A     :  str					     =       "▁"


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







  lowerCamelCase__     =						VOCAB_FILES_NAMES
  lowerCamelCase__     =						PRETRAINED_VOCAB_FILES_MAP
  lowerCamelCase__     =						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  lowerCamelCase__     =						['''input_ids''', '''attention_mask''']
  lowerCamelCase__     =						CamembertTokenizer







  def __init__(							self :       Optional[Any]  ,     __magic_name__ :       Union[str, Any]=None  ,     __magic_name__ :       List[str]=None  ,     __magic_name__ :       int="<s>"  ,     __magic_name__ :       int="</s>"  ,     __magic_name__ :       Optional[Any]="</s>"  ,     __magic_name__ :       str="<s>"  ,     __magic_name__ :       Optional[Any]="<unk>"  ,     __magic_name__ :       str="<pad>"  ,     __magic_name__ :       Optional[Any]="<mask>"  ,     __magic_name__ :       List[str]=["<s>NOTUSED", "</s>NOTUSED"]  ,     **__magic_name__ :       List[str]  ,     )  ->	Optional[int]:
        # Mask token behave like a normal word, i.e. include the space before it
        SCREAMING_SNAKE_CASE_          =  AddedToken(__magic_name__  ,     lstrip=__magic_name__  ,     rstrip=__magic_name__   ) if isinstance(__magic_name__  ,     __magic_name__   ) else mask_token

        super().__init__(
            __magic_name__  ,     tokenizer_file=__magic_name__  ,     bos_token=__magic_name__  ,     eos_token=__magic_name__  ,     sep_token=__magic_name__  ,     cls_token=__magic_name__  ,     unk_token=__magic_name__  ,     pad_token=__magic_name__  ,     mask_token=__magic_name__  ,     additional_special_tokens=__magic_name__  ,     **__magic_name__  ,     )

        SCREAMING_SNAKE_CASE_          =  vocab_file
        SCREAMING_SNAKE_CASE_          =  False if not self.vocab_file else True







  def    __A     (							self :       Any  ,     __magic_name__ :       List[int]  ,     __magic_name__ :       Optional[List[int]] = None   )  ->	List[int]:

        if token_ids_a is None:
              return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
        SCREAMING_SNAKE_CASE_          =  [self.cls_token_id]
        SCREAMING_SNAKE_CASE_          =  [self.sep_token_id]
        return cls + token_ids_a + sep + sep + token_ids_a + sep







  def    __A     (							self :       Dict  ,     __magic_name__ :       List[int]  ,     __magic_name__ :       Optional[List[int]] = None   )  ->	List[int]:
        SCREAMING_SNAKE_CASE_          =  [self.sep_token_id]
        SCREAMING_SNAKE_CASE_          =  [self.cls_token_id]

        if token_ids_a is None:
              return len(cls + token_ids_a + sep   ) * [0]
        return len(cls + token_ids_a + sep + sep + token_ids_a + sep   ) * [0]







  def    __A     (							self :       int  ,     __magic_name__ :       str  ,     __magic_name__ :       Optional[str] = None   )  ->	Tuple[str]:
        if not self.can_save_slow_tokenizer:
              raise ValueError(
                  "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
                  "tokenizer."   )

        if not os.path.isdir(__magic_name__   ):
              logger.error(F'''Vocabulary path ({save_directory}) should be a directory'''   )
              return
        SCREAMING_SNAKE_CASE_          =  os.path.join(
            __magic_name__  ,     (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]   )

        if os.path.abspath(self.vocab_file   ) != os.path.abspath(__magic_name__   ):
              copyfile(self.vocab_file  ,     __magic_name__   )

        return (out_vocab_file,)



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


