






SCREAMING_SNAKE_CASE__				     =			tuple[float, float, float]
SCREAMING_SNAKE_CASE__				     =			tuple[float, float, float]

def        UpperCAmelCase__		(						lowerCamelCase_       :       Pointad   ,  lowerCamelCase_       :       Pointad				):
			__a						:  int									=     end_pointa[0] - end_pointa[0]
			__a						:  List[Any]									=     end_pointa[1] - end_pointa[1]
			__a						:  List[str]									=     end_pointa[2] - end_pointa[2]
			return (x, y, z)

def        UpperCAmelCase__		(						lowerCamelCase_       :       Vectorad   ,  lowerCamelCase_       :       Vectorad				):
			__a						:  List[Any]									=     ab[1] * ac[2] - ab[2] * ac[1]  # *i
			__a						:  List[str]									=     (ab[0] * ac[2] - ab[2] * ac[0]) * -1  # *j
			__a						:  List[str]									=     ab[0] * ac[1] - ab[1] * ac[0]  # *k
			return (x, y, z)

def        UpperCAmelCase__		(						lowerCamelCase_       :       Vectorad   ,  lowerCamelCase_       :       int				):
			return tuple(round(lowerCamelCase_   ,  lowerCamelCase_				) for x in vector				) == (0, 0, 0)

def        UpperCAmelCase__		(						lowerCamelCase_       :       Pointad   ,  lowerCamelCase_       :       Pointad   ,  lowerCamelCase_       :       Pointad   ,  lowerCamelCase_       :       int = 1_0				):
			__a						:  Dict									=     create_vector(lowerCamelCase_   ,  lowerCamelCase_				)
			__a						:  Union[str, Any]									=     create_vector(lowerCamelCase_   ,  lowerCamelCase_				)
			return is_zero_vector(get_ad_vectors_cross(lowerCamelCase_   ,  lowerCamelCase_				)   ,  lowerCamelCase_				)








'''simple docstring'''




from __future__ import annotations


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int | str    ):
  UpperCAmelCase    				=						str(SCREAMING_SNAKE_CASE    )
  return n == n[::-1]


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int = 100_0000    ):
  UpperCAmelCase    				=						0

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


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


