# AOJ 0092 Square Searching

# Python3 2018.6.21 bal4u



cin = [[''] for r in range(1002)]

dp =  [[0 for c in range(1002)] for r in range(1002)]

while 1:

	n = int(eval(input()))

	if n == 0: break

	for r in range(n):

		cin[r] = eval(input())

	ans = 0

	for r in range(n):

		for c in range(n):

			if cin[r][c] == '*': dp[r][c] = 0

			else :

				t = dp[r-1][c-1]

				if t > 0 and dp[r  ][c-1] < t: t = dp[r  ][c-1];

				if t > 0 and dp[r-1][c  ] < t: t = dp[r-1][c  ];

				t += 1

				dp[r][c] = t

				if t > ans: ans = t

	print(ans)



# AOJ 0092 Square Searching

# Python3 2018.6.21 bal4u



cin = [[''] for r in range(1002)]

dp =  [[0 for c in range(1002)] for r in range(1002)]

while 1:

	n = int(eval(input()))

	if n == 0: break

	for r in range(n): cin[r] = eval(input())

	ans = 0

	for r in range(n):

		for c in range(n):

			if cin[r][c] == '*': dp[r][c] = 0

			else :

				t = dp[r-1][c-1]

				if dp[r  ][c-1] < t: t = dp[r  ][c-1];

				if dp[r-1][c  ] < t: t = dp[r-1][c  ];

				t += 1

				dp[r][c] = t

				if t > ans: ans = t

	print(ans)



# AOJ 0092 Square Searching
# Python3 2018.6.21 bal4u
cin = [[""] for r in range(1002)]
dp = [[0 for c in range(1002)] for r in range(1002)]
while 1:
    n = int(eval(input()))
    if n == 0:
        break
    for r in range(n):
        cin[r] = eval(input())
    ans = 0
    for r in range(n):
        for c in range(n):
            if cin[r][c] == "*":
                dp[r][c] = 0
            else:
                t = dp[r - 1][c - 1]
                if t > 0 and dp[r][c - 1] < t:
                    t = dp[r][c - 1]
                if t > 0 and dp[r - 1][c] < t:
                    t = dp[r - 1][c]
                t += 1
                dp[r][c] = t
                if t > ans:
                    ans = t
    print(ans)

# AOJ 0092 Square Searching
# Python3 2018.6.21 bal4u
cin = [[""] for r in range(1002)]
dp = [[0 for c in range(1002)] for r in range(1002)]
while 1:
    n = int(eval(input()))
    if n == 0:
        break
    for r in range(n):
        cin[r] = eval(input())
    ans = 0
    for r in range(n):
        for c in range(n):
            if cin[r][c] == "*":
                dp[r][c] = 0
            else:
                t = dp[r - 1][c - 1]
                if dp[r][c - 1] < t:
                    t = dp[r][c - 1]
                if dp[r - 1][c] < t:
                    t = dp[r - 1][c]
                t += 1
                dp[r][c] = t
                if t > ans:
                    ans = t
    print(ans)

-                if t > 0 and dp[r][c - 1] < t: +                if dp[r][c - 1] < t: -                if t > 0 and dp[r - 1][c] < t: +                if dp[r - 1][c] < t: