Go Board

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given a Go board of size N×NN \times 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.

Input

The first line contains the size of the board NN (3N503 \le N \le 50). Each of the next NN lines contains the state of the board as NN 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.

Output

Print on the first line the largest number of empty points Hongjun can make.