



'''simple docstring'''




from __future__ import annotations



def       a     (					lowerCamelCase__       ):
			'''simple docstring'''





			A_      :		Any      =	str(_UpperCamelCase       )
			return n == n[::-1]



def       a     (					lowerCamelCase__ = 1_00_00_00       ):
			'''simple docstring'''





			A_      :		Optional[Any]      =	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()))))


import re

from filelock import FileLock


try:
      import nltk

      a_     :    Optional[Any]     		=   True
except (ImportError, ModuleNotFoundError):
      a_     :    Union[str, Any]     		=   False

if NLTK_AVAILABLE:
      with FileLock(".lock") as lock:
            nltk.download("punkt", quiet=True)


def 							__lowerCAmelCase     (							_UpperCamelCase		:	str						)		->				str:
 '''simple docstring'''


 re.sub('<n>'		,				''		,				_UpperCamelCase						)  # remove pegasus newline char
 assert NLTK_AVAILABLE, "nltk must be installed to separate newlines between sentences. (pip install nltk)"
 return "\n".join(nltk.sent_tokenize(_UpperCamelCase						)						)

