import sys



while 1:

  n=eval(input())+1

  if n==1:break

  A=[''*n]+[' '+input() for i in range(1,n)]

  M=[[0]*n for i in range(n)]

  for i in range(1,n):

    for j in range(1,n):

      if A[i][j]=='.': M[i][j]=min(M[i-1][j-1],M[i-1][j],M[i][j-1])+1

  print(max(list(map(max,M))))
import sys



while 1:

  n=eval(input())+1

  if n==1:break

  N=list(range(n))

  N1=N[1:]

  A=[''*n]+[' '+input() for i in N1]

  M=[[0]*n for i in N]

  y=M[0]

  for i in N1:

    x=[0]*n

    B=A[i]

    for j in N1:

      if B[j]=='.': x[j]=min(y[j-1],y[j],x[j-1])+1

    M[i]=x

    y=x

  print(max(list(map(max,M))))
import sys

while 1:
    n = eval(input()) + 1
    if n == 1:
        break
    A = ["" * n] + [" " + input() for i in range(1, n)]
    M = [[0] * n for i in range(n)]
    for i in range(1, n):
        for j in range(1, n):
            if A[i][j] == ".":
                M[i][j] = min(M[i - 1][j - 1], M[i - 1][j], M[i][j - 1]) + 1
    print(max(list(map(max, M))))

import sys

while 1:
    n = eval(input()) + 1
    if n == 1:
        break
    N = list(range(n))
    N1 = N[1:]
    A = ["" * n] + [" " + input() for i in N1]
    M = [[0] * n for i in N]
    y = M[0]
    for i in N1:
        x = [0] * n
        B = A[i]
        for j in N1:
            if B[j] == ".":
                x[j] = min(y[j - 1], y[j], x[j - 1]) + 1
        M[i] = x
        y = x
    print(max(list(map(max, M))))

-    A = ["" * n] + [" " + input() for i in range(1, n)] -    M = [[0] * n for i in range(n)] -    for i in range(1, n): -        for j in range(1, n): -            if A[i][j] == ".": -                M[i][j] = min(M[i - 1][j - 1], M[i - 1][j], M[i][j - 1]) + 1 +    N = list(range(n)) +    N1 = N[1:] +    A = ["" * n] + [" " + input() for i in N1] +    M = [[0] * n for i in N] +    y = M[0] +    for i in N1: +        x = [0] * n +        B = A[i] +        for j in N1: +            if B[j] == ".": +                x[j] = min(y[j - 1], y[j], x[j - 1]) + 1 +        M[i] = x +        y = x