


"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE :    Any									=				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE :    str									=				{
    """sayakpaul/vit-msn-base""": """https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json""",
    # See all ViT MSN models at https://huggingface.co/models?filter=vit_msn
}



class 			_UpperCAmelCase (							__snake_case				):






		'''simple docstring'''

		lowerCamelCase__				='vit_msn'



		def __init__(self				,       a_=7_68				,       a_=12				,       a_=12				,       a_=30_72				,       a_="gelu"				,       a_=0.0				,       a_=0.0				,       a_=0.02				,       a_=1E-06				,       a_=2_24				,       a_=16				,       a_=3				,       a_=True				,       **a_				,       ):





			'''simple docstring'''

			super().__init__(**a_					)

			__snake_case	:						Any						=				hidden_size
			__snake_case	:						Optional[Any]						=				num_hidden_layers
			__snake_case	:						int						=				num_attention_heads
			__snake_case	:						Dict						=				intermediate_size
			__snake_case	:						Tuple						=				hidden_act
			__snake_case	:						Optional[int]						=				hidden_dropout_prob
			__snake_case	:						List[Any]						=				attention_probs_dropout_prob
			__snake_case	:						int						=				initializer_range
			__snake_case	:						int						=				layer_norm_eps
			__snake_case	:						Any						=				image_size
			__snake_case	:						Any						=				patch_size
			__snake_case	:						int						=				num_channels
			__snake_case	:						str						=				qkv_bias









"""simple docstring"""
from __future__ import annotations






def 		lowercase							(     _snake_case						:      int | str     )     ->bool:
	"""simple docstring"""





	__snake_case	:						List[str]						=				str(_snake_case     )
	return n == n[::-1]






def 		lowercase							(     _snake_case						:      int = 1_000_000     )     ->str:
	"""simple docstring"""





	__snake_case	:						Union[str, Any]						=				0

	for i in range(1     ,   _snake_case     ):
		if is_palindrome(_snake_case     ) and is_palindrome(bin(_snake_case     ).split('''b'''     )[1]     ):
			total += i
	return total


if __name__ == "__main__":
			print(solution(int(str(input().strip()))))





