


"""simple docstring"""







from math import factorial, pi




def      UpperCAmelCase__ (lowerCAmelCase_						,		lowerCAmelCase_ = 30     ):




					'''simple docstring'''


					if not isinstance(lowerCAmelCase_						,		(int, float)     ):
										raise ValueError("maclaurin_sin() requires either an int or float for theta"     )

					if not isinstance(lowerCAmelCase_						,		lowerCAmelCase_     ) or accuracy <= 0:
										raise ValueError("maclaurin_sin() requires a positive int for accuracy"     )

					__SCREAMING_SNAKE_CASE		     =       float(lowerCAmelCase_     )
					__SCREAMING_SNAKE_CASE		     =       theta // (2 * pi)
					theta -= 2 * div * pi
					return sum(
					    (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1     ) for r in range(lowerCAmelCase_     )     )




def      UpperCAmelCase__ (lowerCAmelCase_						,		lowerCAmelCase_ = 30     ):




					'''simple docstring'''


					if not isinstance(lowerCAmelCase_						,		(int, float)     ):
										raise ValueError("maclaurin_cos() requires either an int or float for theta"     )

					if not isinstance(lowerCAmelCase_						,		lowerCAmelCase_     ) or accuracy <= 0:
										raise ValueError("maclaurin_cos() requires a positive int for accuracy"     )

					__SCREAMING_SNAKE_CASE		     =       float(lowerCAmelCase_     )
					__SCREAMING_SNAKE_CASE		     =       theta // (2 * pi)
					theta -= 2 * div * pi
					return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r     ) for r in range(lowerCAmelCase_     )     )


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		print(maclaurin_sin(1_0))
		print(maclaurin_sin(-1_0))
		print(maclaurin_sin(1_0, 1_5))
		print(maclaurin_sin(-1_0, 1_5))

		print(maclaurin_cos(5))
		print(maclaurin_cos(-5))
		print(maclaurin_cos(1_0, 1_5))
		print(maclaurin_cos(-1_0, 1_5))




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