




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





def    lowerCAmelCase__    (			_UpperCamelCase       :				int | str					)					->				bool:





						"""simple docstring"""






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





def    lowerCAmelCase__    (			_UpperCamelCase       :				int = 1_0_0_0_0_0_0					)					->				Dict:





						"""simple docstring"""






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



"""simple docstring"""
import math





def    lowerCAmelCase__    (			_UpperCamelCase       :				int					)					->				bool:





						"""simple docstring"""






						return math.sqrt(_UpperCamelCase					) * math.sqrt(_UpperCamelCase					) == num





def    lowerCAmelCase__    (			_UpperCamelCase       :				int					)					->				bool:





						"""simple docstring"""






						snake_case								=			0
						snake_case								=			n
						while left <= right:
												snake_case								=			(left + right) // 2
												if mid**2 == n:
																		return True
												elif mid**2 > n:
																		snake_case								=			mid - 1
												else:
																		snake_case								=			mid + 1
						return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()


