Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
s = [[] for i in range(n)]
flag = 0
for i in range(n):
    s[i] = raw_input()
for i in range(n,1,-1):
    for j in range(n-i+1):
        for k in range(n-i+1):
            out = ""
            for l in range(i):
                for m in range(i):
                    out += s[j+l][k+m]
            if out = "."*i:
                print i
                flag = 1
            if flag == 1: break
        if flag == 1: break
    if flag == 1: break

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    if n == 0:
        break
    s = [[] for i in range(n)]
    flag = 0
    for i in range(n):
        s[i] = raw_input()
        for i in range(n,1,-1):
            for j in range(n-i+1):
                for k in range(n-i+1):
                    out = ""
                    for l in range(i):
                        for m in range(i):
                            out += s[j+l][k+m]
                    if out.count("*") == 0:
                        print i
                        flag = 1
                if flag == 1: break
            if flag == 1: break
        if flag == 1: break
    if flag == 0:
        print 1

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    s = [[] for i in range(n)]
    flag = 0
    for i in range(n):
        s[i] = raw_input()
    for i in range(n,0,-1):
        for j in range(n-i+1):
            for k in range(n-i+1):
                out = ""
                for l in range(i):
                    for m in range(i):
                        out += s[j+l][k+m]
                if out.count("*") == 0:
                    print i
                    flag = 1
                if flag == 1: break
            if flag == 1: break
        if flag == 1: break
    if flag == 0:
        print 0

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    if n == 0:
        break
    s = [[] for i in range(n)]
    for i in range(n):
        s[i] = raw_input()
    for i in range(n,0,-1):
        for j in range(n-i+1):
            for k in range(n-i+1):
                flag = 0
                for l in range(i):
                    for m in range(i):
                        if s[j+l][k+m] = "*":
                            flag = 1
                            break
                if flag == 0:
                    print i
                else:
                    break
            if flag == 1: break
        if flag == 1: break
    if flag == 0:
        print 0

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    s = [[] for i in range(n)]
    for i in range(n):
        s[i] = raw_input()
    for i in range(n,0,-1):
        for j in range(n-i+1):
            for k in range(n-i+1):
                flag = 0
                for l in range(i):
                    for m in range(i):
                        if s[j+l][k+m] == "*":
                            flag = 1
                            break
                if flag == 0:
                    print i
                    break
            if flag == 0: break
        if flag == 0: break
    if flag == 1:
        print 0

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Time Limit Exceeded):
while True:
	n = int(raw_input())
	if n == 0: break
	field = [raw_input() for i in range(n)]
	flag = 0
	for len in range(n,-1,-1):
		for row in range(n-len+1):
			for sp in range(n-len+1):
				if field[row][sp:sp+len] == "."*len:
					for i in range(1,len):
						if field[row+i][sp:sp+len] != "."*len:
							if len == 1:
								print 0
							break
					else:
						print len
						flag = 1
				if flag: break
			if flag: break
		if flag: break

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Runtime Error):
l = {".":1,"*":0}
def x(a):
    m=0
    for c in N:
        p=[0]*n 
        for e in range(c,n):
            for r in N:
                p[r]+=l[a[r][e]]
            m=max(P(p),m)
    return m
def P(a):
    m = 0
    for i in N:
        m+=l[a[i]]
    return m
while True:
    n = input()
    if n == 0: break
    N = range(n)
    print x([map(int, raw_input().split()) for i in N])

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Time Limit Exceeded):
l = {".":1,"*":-10000}
def x(a):
	m=0
	for c in N:
		p=[0]*n 
		for e in range(c,n):
			d=e-c+1
			for r in N:
				p[r]+=l[a[r][e]]
			m=max(P(p,d),m)
	return int(m**0.5)
	
def P(a,d):
	m=0
	for i in range(n-d+1):
		k=sum(a[i:i+d])
		m=max(m,k)
	return m
    
while True:
	n=input()
	if n==0:break
	N=range(n)
	print x([raw_input() for i in N])

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))

Buggy python submission (verdict: Time Limit Exceeded):
l = {".":1,"*":-10000}
def x(a):
	m=0
	for c in N:
		p=[0]*n 
		for e in range(c,n):
			d=e-c+1
			for r in N:
				p[r]+=l[a[r][e]]
			m=max(P(p,d),m)
	return int(m**0.5)
	
def P(a,d):
	m=0
	for i in range(n-d+1):
		k = 0
		for j in range(d):
			k+=a[i+j]
			if k<0:break
		else:
			m=max(m,k)
	return m
    
while True:
	n=input()
	if n==0:break
	N=range(n)
	print x([raw_input() for i in N])

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))