# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0092
"""
import sys


def find_square0(data):
    max_size = 0
    lmap = [] # dp??¨???2?¬??????????
    # '.'????????????0??????'*'????????????1????????????
    for row in data:
        temp = []
        for c in row:
            if c == '.':
                temp.append(1)
            else:
                temp.append(0)
        lmap.append(temp)

    # ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
    for y in range(1, len(lmap)):
        for x in range(1, len(lmap[0])):
            if lmap[y][x] == 1:
                lmap[y][x] = min(lmap[y-1][x-1], min(lmap[y-1][x], lmap[y][x-1])) + 1
                if lmap[y][x] > max_size:
                    max_size = lmap[y][x]
    return max_size


def find_square(data):
    max_size = 0
    lmap = []
    for row in data:
        temp = []
        for c in row:
            if c == '.':
                temp.append(1)
            else:
                temp.append(0)
        lmap.append(temp)

    prev_row = lmap[0]
    for curr_row in lmap[1:]:
        for x in range(1, len(lmap[0])):
            if curr_row[x] == 1:
                if prev_row[x-1] != 0 and prev_row[x] != 0 and curr_row[x-1] != 0: #  ???????????¶?????????
                    curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
                    if curr_row[x] > max_size:
                        max_size = curr_row[x]
        prev_row = curr_row
    return max_size


def find_square2(data):
    max_size = 0
    lmap = [] # dp??¨???2?¬??????????
    # '.'????????????0??????'*'????????????1????????????
    for row in data:
        temp = []
        for c in row:
            if c == '.':
                temp.append(1)
            else:
                temp.append(0)
        lmap.append(temp)

    # ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
    # (?????¨???(curr_row)??¨???????????????(prev_row)????????¢????????????????????§?????????????????????)
    prev_row = lmap[0]
    for curr_row in lmap[1:]:
        for x, t in enumerate(curr_row[1:], start=1):
            if t == 1:
                curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
                if curr_row[x] > max_size:
                    max_size = curr_row[x]
        prev_row = curr_row
    return max_size


def find_square3(data):
    from array import array
    max_size = 0
    lmap = [array('B', [0]*len(data[0])) for _ in range(len(data))]
    # '.'????????????0??????'*'????????????1????????????
    for row in data:
        temp = []
        for c in row:
            if c == '.':
                temp.append(1)
            else:
                temp.append(0)
        lmap.append(temp)

    # ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
    # (?????¨???(curr_row)??¨???????????????(prev_row)????????¢????????????????????§?????????????????????)
    prev_row = lmap[0]
    for curr_row in lmap[1:]:
        for x, t in enumerate(curr_row[1:], start=1):
            if t == 1:
                curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
                if curr_row[x] > max_size:
                    max_size = curr_row[x]
        prev_row = curr_row
    return max_size


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        data = [input() for _ in range(n)]
        result = find_square3(data)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 36312