#!/usr/bin/env python



from sys import stdin, exit





def main(readline=stdin.readline):

    while 1:

        n = int(readline())

        if not n:

            exit()



        pre = [0] * (n+1)

        now = [0] * (n+1)

        maximum = 0



        for _ in range(n):

            for x, c in enumerate(readline().rstrip(), 1):

                if c == '.':

                    now[x] = min(pre[x-1], pre[x], now[x-1]) + 1

                    if maximum < now[x]:

                        maximum = now[x]



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

                pre[x] = now[x]

                now[x] = 0



        print(maximum)





main()
#!/usr/bin/env python



from sys import stdin, exit





def main(readline=stdin.readline):

    while 1:

        n = int(readline())

        if not n:

            exit()



        pre = [0] * (n+1)

        now = [0] * (n+1)

        maximum = 0



        for _ in range(n):

            for x, c in enumerate(readline().rstrip(), 1):

                if c == '.':

                    now[x] = min(pre[x-1], pre[x], now[x-1]) + 1

                    if maximum < now[x]:

                        maximum = now[x]

            pre = now

            now = [0] * (n+1)



        print(maximum)





main()
#!/usr/bin/env python
from sys import stdin, exit


def main(readline=stdin.readline):
    while 1:
        n = int(readline())
        if not n:
            exit()
        pre = [0] * (n + 1)
        now = [0] * (n + 1)
        maximum = 0
        for _ in range(n):
            for x, c in enumerate(readline().rstrip(), 1):
                if c == ".":
                    now[x] = min(pre[x - 1], pre[x], now[x - 1]) + 1
                    if maximum < now[x]:
                        maximum = now[x]
            for x in range(1, n + 1):
                pre[x] = now[x]
                now[x] = 0
        print(maximum)


main()

#!/usr/bin/env python
from sys import stdin, exit


def main(readline=stdin.readline):
    while 1:
        n = int(readline())
        if not n:
            exit()
        pre = [0] * (n + 1)
        now = [0] * (n + 1)
        maximum = 0
        for _ in range(n):
            for x, c in enumerate(readline().rstrip(), 1):
                if c == ".":
                    now[x] = min(pre[x - 1], pre[x], now[x - 1]) + 1
                    if maximum < now[x]:
                        maximum = now[x]
            pre = now
            now = [0] * (n + 1)
        print(maximum)


main()

-            for x in range(1, n + 1): -                pre[x] = now[x] -                now[x] = 0 +            pre = now +            now = [0] * (n + 1)