Domino
题号:NC209431
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

For an grid which is fully covered by and domnios, Bobo can perform the following two kinds of operations.

* Choose a subgrid which is covered by two domnios, replace the two domnios with two ones.
* Choose a subgrid which is covered by two domnios, replace the two domnios with two ones.

Bobo has two grids which are fully covered by domnios.
He would like to know the minimum number of operations to make them identical.

输入描述:

The input consists of several test cases terminated by end-of-file.

The first line of each test case contains two integers n and m.
The following n lines describe the domino covering of the first grid. The i-th line contains m characters .
If the cell (i, j) is covered by a domnio, equals to `-`, otherwise it equals to `|`.
The following n lines describe the domino covering of the second grid B in the same way.

*
* , is either `|` or `-`.
* The sum of does not exceed .

输出描述:

For each test case, print an integer which denotes the result.

示例1

输入

复制
2 2
||
||
||
||
2 2
||
||
--
--
2 8
|----|||
|----|||
||--||||
||--||||

输出

复制
0
1
3