stea

Gigel got the task of making the star that will be put on top of the school's Christmas tree. To do this he prepared a silver sheet of paper in the shape of an equilateral triangle. The sheet of paper has a very nice design. It is divided into n bands. Each band has a model made up of small equilateral triangles, (having a side length of 1 cm), placed alternatively (one with the top up, the next with the top down, etc), like in the image.
When he starts working - disaster strikes! His little sister had cut out some smaller triangles from his sheet of paper. Gigel's only solution is to cut out from his sheet of paper an equilateral triangle shaped part that has the largest possible surface area and doesn't contain any holes.

Task

Determine the number of small equilateral triangles contained by the largest (maximum possible) equilateral triangle area not having any holes.

Input Data

Input file stea.in contains on the first line a positive integer n representing the number of bands of the triangle. The following n lines contain information about the look of the sheet of paper. Line i+1 contains a sequence of characters representing the ith band of the sheet of paper. The characters from the sequence can be # (which means that the small triangle was cut out) or - (which means that the small triangle hasn't been cut out) or a space (used at the beginning of each line, in order to keep the sheet's triangular aspect).

Output Data

Output file stea.out contains a single line with a positive integer, representing the number of small equilateral triangles from which the largest equilateral triangle shaped area that doesn't contain any holes is made of.

Restrictions

  • 1 <= n <= 100

Examples

stea.in stea.out stea.in stea.out

5
#-##----#
 -----#-
  ---#-
   -#-
    -

9 4
#-#-#--
 #---#
  ##-
   -
4

Time limit: 0.2 seconds/test

Marinel Serban
"Gr. C. Moisil" Iaşi IT High School
marinel_serban@yahoo.com