Matching

Compute the maximum cardinality matching of given undirected graph \(G\).

Input

The first line contains one integer \(n\), which denotes the number of nodes.

The following \(n\) lines denotes the adjacency matrix \(A\) of graph \(G\).

(\(1 \leq n \leq 100\), \(A_{i, j} \in \{0, 1\}\), \(A_{i, i} = 0\), \(A_{i, j} = A_{j, i}\))

Output

The only integer equals to the size of maximum cardinality matching.

Sample input

3
0 1 1
1 0 1
1 1 0

Sample output

1

Note

One of possible matchings is to pair node \(1\) and \(2\), leaving node \(3\) alone.