There is a bipartite graph with vertices on the left and vertices on the right. Let denote whether there is an edge between left vertex and right vertex . There is an edge if , and there is no edge if .
You know the entire graph, but another person initially knows nothing about which edges exist.
You may choose any pair and reveal whether the edge between those two vertices exists. Revealing the information for costs . The total cost is the sum of over all revealed pairs.
The existence of an edge for an unrevealed pair remains unknown. As long as all revealed information is respected, the existence of each unrevealed edge may be chosen independently and arbitrarily.
The revealed information is called sufficient if every bipartite graph consistent with it has the same maximum matching size as the original graph.
Find the minimum total cost required to reveal sufficient information.
The input is given in the following format.
Print the minimum total cost required to reveal sufficient information.
is a binary string of length , and its -th character represents .