code: 
  
  
  '''simple docstring'''
  
  
  
  A__	:      List[Any]				=						float("""inf""")
  
  
  
  
  
  class      UpperCAmelCase_						:
  
  
  
  
  
      """simple docstring"""
  
  
  
  
  
  
      def __init__(							self    ,  SCREAMING_SNAKE_CASE_			)       ->  int:
           __lowerCamelCase     :			Dict              =	[0] * n
           __lowerCamelCase     :			Optional[int]              =	[0] * n
           __lowerCamelCase     :			str              =	[0] * n
           __lowerCamelCase     :			Optional[Any]              =	[[] for _ in range(SCREAMING_SNAKE_CASE_			)]
  
  
  
  
  
  
  
      def    lowercase_       (							self    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_=0			)       ->  List[Any]:
           self.adj[a].append([b, len(self.adj[b]			), c, 0]			)
           self.adj[b].append([a, len(self.adj[a]			) - 1, rcap, 0]			)
  
  
  
  
  
  
  
      def    lowercase_       (							self    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_			)       ->  int:
           if vertex == sink or not flow:
                return flow
  
           for i in range(self.ptr[vertex]    ,  len(self.adj[vertex]			)			):
                __lowerCamelCase     :			Optional[int]              =	self.adj[vertex][i]
                if self.lvl[e[0]] == self.lvl[vertex] + 1:
                     __lowerCamelCase     :			Any              =	self.depth_first_search(e[0]    ,  SCREAMING_SNAKE_CASE_    ,  min(SCREAMING_SNAKE_CASE_    ,  e[2] - e[3]			)			)
                     if p:
                          self.adj[vertex][i][3] += p
                          self.adj[e[0]][e[1]][3] -= p
                          return p
                __lowerCamelCase     :			Union[str, Any]              =	self.ptr[vertex] + 1
           return 0
  
  
  
  
  
  
  
      def    lowercase_       (							self    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_			)       ->  Any:
           __lowerCamelCase       , __lowerCamelCase     :			Any              =	0, source
           for l in range(31			):  # noqa: E741  l = 30 maybe faster for random data
                while True:
                     __lowerCamelCase       , __lowerCamelCase     :			Optional[int]              =	[0] * len(self.q			), [0] * len(self.q			)
                     __lowerCamelCase       , __lowerCamelCase       , __lowerCamelCase     :			Union[str, Any]              =	0, 1, 1
                     while qi < qe and not self.lvl[sink]:
                          __lowerCamelCase     :			int              =	self.q[qi]
                          qi += 1
                          for e in self.adj[v]:
                               if not self.lvl[e[0]] and (e[2] - e[3]) >> (30 - l):
                                    __lowerCamelCase     :			int              =	e[0]
                                    qe += 1
                                    __lowerCamelCase     :			int              =	self.lvl[v] + 1
  
                     __lowerCamelCase     :			List[Any]              =	self.depth_first_search(SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_			)
                     while p:
                          flow += p
                          __lowerCamelCase     :			Dict              =	self.depth_first_search(SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_    ,  SCREAMING_SNAKE_CASE_			)
  
                     if not self.lvl[sink]:
                          break
  
           return flow
  A__	:      Optional[int]				=						Dinic(10)
  A__	:      Dict				=						0
  A__	:      List[str]				=						9
  for vertex in range(1, 5):
        graph.add_edge(source, vertex, 1)
  for vertex in range(5, 9):
        graph.add_edge(vertex, sink, 1)
  for vertex in range(1, 5):
        graph.add_edge(vertex, vertex + 4, 1)
  
  # Now we can know that is the maximum flow(source -> sink)
  print(graph.max_flow(source, sink))
  
  
  
  
  
  
  
style_context: 
  
  
  '''simple docstring'''
  
  
  
  def     UpperCAmelCase__      (			UpperCAmelCase_					:       str							)  ->	int:
       __lowerCamelCase     :			Tuple              =	str(UpperCAmelCase_							).strip()
       if not bin_string:
            raise ValueError('Empty string was passed to the function'							)
       __lowerCamelCase     :			Optional[int]              =	bin_string[0] == '-'
       if is_negative:
            __lowerCamelCase     :			List[Any]              =	bin_string[1:]
       if not all(char in '01' for char in bin_string							):
            raise ValueError('Non-binary value was passed to the function'							)
       __lowerCamelCase     :			Optional[int]              =	0
       for char in bin_string:
            __lowerCamelCase     :			str              =	2 * decimal_number + int(UpperCAmelCase_							)
       return -decimal_number if is_negative else decimal_number
  
  
  if __name__ == "__main__":
        from doctest import testmod
  
        testmod()
  
  
  
  
  
  
  