






"""simple docstring"""



from __future__ import annotations




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int | str      )		->bool:
						A__						:  Optional[Any]		  =  str(UpperCAmelCase__      )
						return n == n[::-1]




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int = 1_0_0_0_0_0_0      )		->int:
						A__						:  str		  =  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"""



def      _lowerCAmelCase		(							UpperCAmelCase__       :					str,						UpperCAmelCase__       :					List[Any]      )		->List[Any]:
						A__						:  Union[str, Any]		  =  [1]
						for i in range(2,						UpperCAmelCase__      ):
												factorials.append(factorials[-1] * i      )
						assert 0 <= k < factorials[-1] * n, "k out of bounds"

						A__						:  Optional[int]		  =  []
						A__						:  List[str]		  =  list(range(UpperCAmelCase__      )      )

						# Find permutation
						while factorials:
												A__						:  Optional[int]		  =  factorials.pop()
												A__  ,  A__						:  Optional[int]		  =  divmod(UpperCAmelCase__,						UpperCAmelCase__      )
												permutation.append(elements[number]      )
												elements.remove(elements[number]      )
						permutation.append(elements[0]      )

						return permutation


if __name__ == "__main__":
						import doctest

						doctest.testmod()






