Border#2507

Border

1 second
128 megabytes
Very easy

In international politics, an important concept is the border between states. Uncertainty in determining where the border lies can lead to international conflicts and even wars.

In this problem, the situation is simpler, since both states know exactly which territory belongs to each of them.

The area occupied by the two states forms a rectangle of size h \times w kilometers, divided into squares with a side of 1 kilometer. Each square fully belongs to one of the states.

Find the length of the border between the two states. A side of a square is considered part of the border if one of its sides belongs to one state and the other side belongs to the other state.

Input

The first line contains two integers and h~(1 \le w, h \le 100) — the width and height of the rectangle in kilometers. The following lines describe the territory. Each line contains characters: if a character is , the corresponding unit square belongs to the first state; if , it belongs to the second state. It is guaranteed that each state has at least one square.

The territory of each state forms a connected area.

Output

Print one number — the length of the border between the states in kilometers.

Examples

Example 1

Loading
Loading