Chessboard#13093

Chessboard

1 second
256 megabytes

You are given a table with rows and columns. Each cell contains or .

You must delete exactly one row and exactly one column. The remaining rows and columns then shift to close the gaps. Their original order is preserved.

After that, in one operation, you can change the value of a single cell from to or vice versa.

You need to obtain a table in which:

Find the minimum number of such operations, choosing the row and column to delete optimally.

Input

The first line contains two integers and (2 \leq n,m \leq 2000) — the number of rows and columns in the table.

Each of the next lines contains a string of length , consisting only of the characters and .

Output

Print one integer — the minimum number of operations needed to change cell values.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading

Note

In the first example, deleting the second row and the second column leaves a table with rows 01 and 10. No cell values need to be changed.

In the second example, you can delete the third row and the fifth column. In the remaining table, it is enough to change the cell in the third row and the first column from to . It is impossible to obtain the required table without changing any cell values.

In the third example, no matter which row and column are deleted, a single cell containing remains. Its value must be changed to .

Scoring

  1. points — n,m \leq 20.

  2. points — \min(n,m) \leq 20.

  3. points — no additional constraints.