





'''simple docstring'''






from __future__ import annotations






def      __A						(							a_						:  int | str	):
		lowerCAmelCase     :    str						=   str(snake_case_	)
		return n == n[::-1]






def      __A						(							a_						:  int = 1_0_0_0_0_0_0	):
		lowerCAmelCase     :    Tuple						=   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()))))










'''simple docstring'''






def      __A						(							a_						:  int	):
		if not isinstance(a_      ,a_	):
				lowerCAmelCase     :    Dict						=   f'''Input value of [number={number}] must be an integer'''
				raise TypeError(a_	)
		if number < 0:
				return False
		lowerCAmelCase     :    Dict						=   number * number
		while number > 0:
				if number % 1_0 != number_square % 1_0:
						return False
				number //= 1_0
				number_square //= 1_0
		return True


if __name__ == "__main__":
					import doctest

					doctest.testmod()



