while True:

    n = int(input())

    if n == 0: break

    field = [input() for i in range(n)]

    large = [[0] * (n + 1) for i in range(n + 1)]

    mx = 0

    for i in range(n):

        for j in range(n):

            if field[i][j] == '.':

                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1

                if large[i][j] > mx:

                	mx = large[i][j]

    print(mx)
while True:

    n = int(input())

    if n == 0: break

    field = [input() for i in range(n)]

    large = [[0]*(n + 1) for i in range(n + 1)]

    mx = 0

    for i in range(n):

        for j in range(n):

            if field[i][j] == '.':

                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1

    print(max(list(map(max, large))))
while True:
    n = int(input())
    if n == 0:
        break
    field = [input() for i in range(n)]
    large = [[0] * (n + 1) for i in range(n + 1)]
    mx = 0
    for i in range(n):
        for j in range(n):
            if field[i][j] == ".":
                large[i][j] = (
                    min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
                )
                if large[i][j] > mx:
                    mx = large[i][j]
    print(mx)

while True:
    n = int(input())
    if n == 0:
        break
    field = [input() for i in range(n)]
    large = [[0] * (n + 1) for i in range(n + 1)]
    mx = 0
    for i in range(n):
        for j in range(n):
            if field[i][j] == ".":
                large[i][j] = (
                    min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
                )
    print(max(list(map(max, large))))

-                if large[i][j] > mx: -                    mx = large[i][j] -    print(mx) +    print(max(list(map(max, large))))