


"""simple docstring"""







import os
import unittest

from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer
from transformers.testing_utils import get_tests_dir

from ...test_tokenization_common import TokenizerTesterMixin


a__       :							Optional[Any]        =  get_tests_dir('''fixtures/test_sentencepiece_bpe.model''')




class 				UpperCamelCase_			(				_snake_case    ,						unittest.TestCase):

	"""simple docstring"""





	snake_case__       :						Union[str, Any]					      =    BartphoTokenizer
	snake_case__       :						List[Any]					      =    False
	snake_case__       :						Union[str, Any]					      =    True




	def 						UpperCAmelCase_   (				self    :       int     ) ->			List[Any]:
						super().setUp()

						__SCREAMING_SNAKE_CASE		     =       ["▁This", "▁is", "▁a", "▁t", "est"]
						__SCREAMING_SNAKE_CASE		     =       dict(zip(UpperCAmelCase__    ,    range(len(UpperCAmelCase__     )     )     )     )
						__SCREAMING_SNAKE_CASE		     =       {"unk_token": "<unk>"}

						__SCREAMING_SNAKE_CASE		     =       os.path.join(self.tmpdirname    ,    VOCAB_FILES_NAMES["monolingual_vocab_file"]     )
						with open(self.monolingual_vocab_file    ,    "w"    ,    encoding="utf-8"     ) as fp:
											for token in vocab_tokens:
																fp.write(F"""{token} {vocab_tokens[token]}\n"""     )

						__SCREAMING_SNAKE_CASE		     =       BartphoTokenizer(UpperCAmelCase__    ,    self.monolingual_vocab_file    ,    **self.special_tokens_map     )
						tokenizer.save_pretrained(self.tmpdirname     )




	def 						UpperCAmelCase_   (				self    :       str    ,    **UpperCAmelCase__    :       List[Any]     ) ->			Optional[Any]:
						kwargs.update(self.special_tokens_map     )
						return BartphoTokenizer.from_pretrained(self.tmpdirname    ,    **UpperCAmelCase__     )




	def 						UpperCAmelCase_   (				self    :       Optional[Any]    ,    UpperCAmelCase__    :       int     ) ->			Dict:
						__SCREAMING_SNAKE_CASE		     =       "This is a là test"
						__SCREAMING_SNAKE_CASE		     =       "This is a<unk><unk> test"
						return input_text, output_text




	def 						UpperCAmelCase_   (				self    :       Optional[int]     ) ->			Tuple:
						__SCREAMING_SNAKE_CASE		     =       BartphoTokenizer(UpperCAmelCase__    ,    self.monolingual_vocab_file    ,    **self.special_tokens_map     )
						__SCREAMING_SNAKE_CASE		     =       "This is a là test"
						__SCREAMING_SNAKE_CASE		     =       "▁This ▁is ▁a ▁l à ▁t est".split()
						__SCREAMING_SNAKE_CASE		     =       tokenizer.tokenize(UpperCAmelCase__     )
						self.assertListEqual(UpperCAmelCase__    ,    UpperCAmelCase__     )

						__SCREAMING_SNAKE_CASE		     =       tokens + [tokenizer.unk_token]
						__SCREAMING_SNAKE_CASE		     =       [4, 5, 6, 3, 3, 7, 8, 3]
						self.assertListEqual(tokenizer.convert_tokens_to_ids(UpperCAmelCase__     )    ,    UpperCAmelCase__     )




"""simple docstring"""







from __future__ import annotations




def      UpperCAmelCase__ (lowerCAmelCase_     ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE		     =       str(lowerCAmelCase_     )
					return n == n[::-1]




def      UpperCAmelCase__ (lowerCAmelCase_ = 100_0000     ):




					'''simple docstring'''


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