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.