You are given a Go board of size N×N. A white stone is written as o, a black stone as x, and an empty point as .. On the board you are given, no two white stones touch up, down, left or right, so every white stone is a group of one.
Hongjun may place as many extra black stones on empty points as he wants. A white stone is captured and taken off the board once all four of its neighbors up, down, left and right are black stones or lie outside the board, and the point it sat on becomes empty. In one small departure from real Go, white never captures black, so a black stone that has been placed stays on the board to the end.
What Hongjun looks at is the number of empty points left at the end. Capturing a white stone turns its point into an empty one, but a point covered by a black stone is no longer empty. So he is stuck on where to play and how many stones to use.
Help Hongjun and write a program that maximizes the number of empty points.
The first line contains the size of the board N (3≤N≤50). Each of the next N lines contains the state of the board as N characters. A white stone is o, a black stone is x, and an empty point is .. No two white stones are adjacent up, down, left or right.
Print on the first line the largest number of empty points Hongjun can make.