while(1):
    n = int(input())
    if n == 0:
        break
    a = [0 for i in range(n)]
    b = [[0 for i in range(n)] for j in range(n)]
    c_ = [[2000 for i in range(n)] for j in range(n)]
    c = [[0 for i in range(n)] for j in range(n)]
    for i in range(n):
        a[i] = [0 if i == "." else 1 for i in list(input())]
        for j in range(n):
            for k in range(j,n):
                if a[i][k] == 1:
                    break
                b[i][j] = k-j+1
                
    for col in range(n):
        for i in range(n):
            for j in range(i,n):
                min_ = min(c_[i][col], b[j][col])
                if min_ < j-i+1:
                    break
                c_[i][col] = min_
                c[i][col] = j-i+1
    
    print(max([max(i) for i in c]))

