Flood Fill
시간 제한2초메모리 제한1024 MB
같은 색 연결 성분을 뒤집는 플러드 필을 여러 번 적용해 A와 B가 다른 칸 수의 최솟값을 구한다.
문제
Given are two black and white images and .
The "flood fill" tool works as follows: you choose any cell , locate its connected component and flip the colors of all the cells in the component (if the cell was black, it becomes white, and if it was white, it becomes black). The connected component of the cell is the set of cells you can reach by going up/down/left/right without changing color.
You can apply the "flood fill" tool to image any number of times. What is the minimum number of cells in which can be different from after some sequence of operations?
입력
The first line of input contains two integers and () --- the dimensions of the images.
Each of the next lines contains a binary string of length , describing the corresponding row of the image .
Each of the next lines contains a binary string of length , describing the corresponding row of the image .
Here 0 corresponds to the cell colored white, 1 corresponds to the cell colored black.
출력
Output a single integer --- the minimum possible number of cells in which can be different from after some sequence of operations.
힌트
In the first example, you can apply the tool to the middle cell twice. This way, two images will differ only in cell.

In the second example, you can just make the entire image black. This way, two images will differ in cells.
