Death-Moon loves telling stories.
Some days ago, he told us a scaring story.
Long long ago, there were many ghosts living in each island.
Humans wanted to wipe out the ghosts, so they began to build bridges to link all islands, either connecting directly or not directly.
输入
Input until EOF. Input two positive integers M(1 <= M <= 55) and N(1 <= N <= 55) means the map. Then follows M lines, each line includes N characters only includes zero and '+', zero means a part of the island, '+' means a part of sea.
输出
You should output the minimum number of bridges should be built.