





'''simple docstring'''




class  SCREAMING_SNAKE_CASE    :


     def __init__(						self						,	_UpperCAmelCase						,	_UpperCAmelCase=None						,	_UpperCAmelCase=None):

          '''simple docstring'''






          __A						: Tuple      =       data
          __A						: List[Any]      =       previous
          __A						: Tuple      =       next_node


     def __str__(						self):

          '''simple docstring'''






          return F'{self.data}'


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return self.data


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return self.next


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return self.previous




class  SCREAMING_SNAKE_CASE    :


     def __init__(						self						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: int      =       head


     def __iter__(						self):

          '''simple docstring'''






          return self


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          if not self.current:
               raise StopIteration
          else:
               __A						: Union[str, Any]      =       self.current.get_data()
               __A						: Tuple      =       self.current.get_next()
               return value




class  SCREAMING_SNAKE_CASE    :


     def __init__(						self):

          '''simple docstring'''






          __A						: Optional[int]      =       None  # First node in list
          __A						: Union[str, Any]      =       None  # Last node in list


     def __str__(						self):

          '''simple docstring'''






          __A						: Any      =       self.head
          __A						: Any      =       []
          while current is not None:
               nodes.append(current.get_data())
               __A						: Optional[Any]      =       current.get_next()
          return " ".join(str(A_) for node in nodes)


     def __contains__(						self						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Any      =       self.head
          while current:
               if current.get_data() == value:
                    return True
               __A						: Dict      =       current.get_next()
          return False


     def __iter__(						self):

          '''simple docstring'''






          return LinkedListIterator(self.head)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          if self.head:
               return self.head.get_data()
          return None


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          if self.tail:
               return self.tail.get_data()
          return None


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          if self.head is None:
               __A						: Optional[Any]      =       node
               __A						: Optional[int]      =       node
          else:
               self.insert_before_node(self.head						,	A_)


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          if self.head is None:
               self.set_head(A_)
          else:
               self.insert_after_node(self.tail						,	A_)


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Any      =       Node(A_)
          if self.head is None:
               self.set_head(A_)
          else:
               self.set_tail(A_)


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Any      =       node
          __A						: Dict      =       node.previous

          if node.get_previous() is None:
               __A						: int      =       node_to_insert
          else:
               __A						: Dict      =       node_to_insert

          __A						: str      =       node_to_insert


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Dict      =       node
          __A						: str      =       node.next

          if node.get_next() is None:
               __A						: Tuple      =       node_to_insert
          else:
               __A						: Optional[int]      =       node_to_insert

          __A						: str      =       node_to_insert


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Dict      =       1
          __A						: Optional[int]      =       Node(A_)
          __A						: Optional[Any]      =       self.head
          while node:
               if current_position == position:
                    self.insert_before_node(A_						,	A_)
                    return
               current_position += 1
               __A						: Any      =       node.next
          self.insert_after_node(self.tail						,	A_)


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          __A						: Union[str, Any]      =       self.head
          while node:
               if node.get_data() == item:
                    return node
               __A						: Optional[Any]      =       node.get_next()
          raise Exception('Node not found')


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          if (node := self.get_node(A_)) is not None:
               if node == self.head:
                    __A						: Optional[Any]      =       self.head.get_next()

               if node == self.tail:
                    __A						: str      =       self.tail.get_previous()

               self.remove_node_pointers(A_)


     @staticmethod
     def 							SCREAMING_SNAKE_CASE  (						_UpperCAmelCase):

          '''simple docstring'''






          if node.get_next():
               __A						: List[Any]      =       node.previous

          if node.get_previous():
               __A						: List[str]      =       node.next

          __A						: Optional[int]      =       None
          __A						: List[str]      =       None


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return self.head is None






def        _lowerCAmelCase			(  )     ->     Dict:
     pass





if __name__ == "__main__":
  import doctest

  doctest.testmod()





def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       int = 10_00     ):


      '''simple docstring'''



      lowerCamelCase_		     =    2**power
      lowerCamelCase_		     =    0
      while n:
            lowerCamelCase_     ,				lowerCamelCase_		     =    r + n % 10, n // 10
      return r


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



