


'''simple docstring'''



from __future__ import annotations




def      _a     (						_lowercase :     int | str  ):





     '''simple docstring'''






     __UpperCAmelCase     :			Any  							=      str(_lowercase  )
     return n == n[::-1]




def      _a     (						_lowercase :     int = 1000000  ):





     '''simple docstring'''






     __UpperCAmelCase     :			Dict  							=      0

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


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



'''simple docstring'''



def      _a     (						_lowercase :     int = 600851475143  ):





     '''simple docstring'''






     try:
          __UpperCAmelCase     :			str  							=      int(_lowercase  )
     except (TypeError, ValueError):
          raise TypeError('''Parameter n must be int or castable to int.'''  )
     if n <= 0:
          raise ValueError('''Parameter n must be greater than or equal to one.'''  )
     __UpperCAmelCase     :			Dict  							=      1
     __UpperCAmelCase     :			List[str]  							=      2
     while i * i <= n:
          while n % i == 0:
               __UpperCAmelCase     :			int  							=      i
               n //= i
          i += 1
     if n > 1:
          __UpperCAmelCase     :			List[str]  							=      n
     return int(_lowercase  )


if __name__ == "__main__":
      print(f"""{solution() = }""")