E. Experiment with cells
time limit per test
9.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Dr senku

Dr Senku, the scientist, has discovered a new kind of cell! They are a really interesting kind of organism that interacts with electricity in weird ways. Each cell can either be red colored or blue colored. When zapped with electricity, the cell transitions from its color to the contrary, that is, a red cell will become blue and a blue cell will become red.

Senku has set the cells in a rectangular matrix of size $$$N\times M$$$. He can zap a whole column or row of the matrix, changing the color of all its cells. He can also zap an individual cell by hand, but this takes a lot of work, so he tries to avoid it.

This morning, he got a request from his university director to make it so all cells are red by the end of the day. Since he is very lazy, he first wants to know what the minimum number of times he will have to zap an individual cell to achieve this. Help him find this number!

Input

On the first line, numbers $$$N,M$$$ ($$$1\leq N\times M\leq760$$$). On the next $$$N$$$ lines, $$$M$$$ letters either "R" or "B" representing the cell is blue or red at the moment.

Output

Just a number, the minimum number of times he will have to zap an individual cell.

Examples
Input
2 2
BB
BB
Output
0
Input
2 2
BR
RR
Output
1
Note

"You get ten billion points"