while True:

    n=eval(input())

    if n==0:

        break

    dp=[[0 for i in range(n)]for j in range(n)]

    for i in range(n):

        j=0

        for c in input():

            if c == ".":

                dp[i][j]=1

            j+=1

    for i in range(1,n):

        for j in range(1,n):

            if dp[i][j]==1:

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

    allmax=0

    for i in range(n):

        if allmax<max(dp[i]):

            allmax=max(dp[i])

    print(allmax)
while True:

    n=eval(input())

    if n==0:

        break

    dp=[[0 for i in range(n+1)]for j in range(n+1)]

    for i in range(1,n+1):

        j=0

        line=" "+input()

        for c in line:

            if c == ".":

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

            j+=1

    allmax=0

    for i in range(n+1):

        if allmax<max(dp[i]):

            allmax=max(dp[i])

    print(allmax)
while True:
    n = eval(input())
    if n == 0:
        break
    dp = [[0 for i in range(n)] for j in range(n)]
    for i in range(n):
        j = 0
        for c in input():
            if c == ".":
                dp[i][j] = 1
            j += 1
    for i in range(1, n):
        for j in range(1, n):
            if dp[i][j] == 1:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1
    allmax = 0
    for i in range(n):
        if allmax < max(dp[i]):
            allmax = max(dp[i])
    print(allmax)

while True:
    n = eval(input())
    if n == 0:
        break
    dp = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for i in range(1, n + 1):
        j = 0
        line = " " + input()
        for c in line:
            if c == ".":
                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1
            j += 1
    allmax = 0
    for i in range(n + 1):
        if allmax < max(dp[i]):
            allmax = max(dp[i])
    print(allmax)

-    dp = [[0 for i in range(n)] for j in range(n)] -    for i in range(n): +    dp = [[0 for i in range(n + 1)] for j in range(n + 1)] +    for i in range(1, n + 1): -        for c in input(): +        line = " " + input() +        for c in line: -                dp[i][j] = 1 +                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1 -    for i in range(1, n): -        for j in range(1, n): -            if dp[i][j] == 1: -                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1 -    for i in range(n): +    for i in range(n + 1):