Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    ans = 0
    for i in range(n):
        p = [(x, y) for x in range(n - i) for y in range(n - i)]
        for x, y in p:
            if inp[y][x] == ".":
                pp = [(xx, yy) for xx in range(x, x + i + 1) for yy in range(y, y + i + 1)]
                for xx, yy in pp:
                    if inp[yy][xx] == "*":
                        break
                else:
                    ans = i + 1
                    break
        else:
            continue
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    ans = 0
    p_all = set([(x, y) for x in range(n) for y in range(n)])
    for i in range(n):
        p = [(x, y) for x in range(n - i) for y in range(n - i) if (x, y) in p_all]
        for x, y in p:
            if inp[y][x] == ".":
                pp = [(xx, yy) for xx in range(x, x + i + 1) for yy in range(y, y + i + 1)]
                for xx, yy in pp:
                    if inp[yy][xx] == "*":
                        p_all.remove((x, y))
                        break
                else:
                    ans = i + 1
                    break
        else:
            continue
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    ans = 0
    for i in range(n)[::-1]:
        p = [(x, y) for x in range(n - i) for y in range(n - i)]
        for x, y in p:
            if inp[y][x] == ".":
                pp = [(xx, yy) for xx in range(x, x + i + 1) for yy in range(y, y + i + 1)]
                for xx, yy in pp:
                    if inp[yy][xx] == "*":
                        break
                else:
                    ans = i + 1
                    break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sum_dot = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for y in range(n):
        for x in range(n):
            sum_dot[y + 1][x + 1] = sum_dot[y][x + 1] + inp[y][:x + 1].count(".")
    
    ans = 0
    for i in range(n)[::-1]:
        p = [(x, y) for y in range(n - i) for x in range(n - i)]
        for x, y in p:
            s = sum_dot[y + i + 1][x + i + 1] - sum_dot[y][x + i + 1] - sum_dot[y + i + 1][x] + sum_dot[y][x]
            if s == (i + 1)*(i + 1):
                ans = i + 1
                break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sum_dot = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for y in range(n):
        for x in range(n):
            sum_dot[y + 1][x + 1] = sum_dot[y][x + 1] + inp[y][:x + 1].count(".")
    
    ans = 0
    for i in range(n)[::-1]:
        p = [(x, y) for y in range(n - i) for x in range(n - i)]
        for x, y in p:
            s = sum_dot[y + i + 1][x + i + 1] - sum_dot[y][x + i + 1] - sum_dot[y + i + 1][x] + sum_dot[y][x]
            if s == (i + 1)*(i + 1):
                ans = i + 1
                break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sum_dot = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for y in range(n):
        for x in range(n):
            sum_dot[y + 1][x + 1] = sum_dot[y][x + 1] + inp[y][:x + 1].count(".")
    
    ans = 0
    for i in range(n)[::-1]:
        p = [(x, y) for y in range(n - i) for x in range(n - i)]
        for x, y in p:
            s = sum_dot[y + i + 1][x + i + 1] - sum_dot[y][x + i + 1] - sum_dot[y + i + 1][x] + sum_dot[y][x]
            if s == (i + 1)*(i + 1):
                ans = i + 1
                break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math

while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sum_dot = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for y in range(n):
        for x in range(n):
            sum_dot[y + 1][x + 1] = sum_dot[y][x + 1] + inp[y][:x + 1].count(".")
    
    ans = 0
    for i in range(int(math.sqrt(sum_dot[-1][-1])))[::-1]:
        p = [(x, y) for y in range(n - i) for x in range(n - i)]
        for x, y in p:
            s = sum_dot[y + i + 1][x + i + 1] - sum_dot[y][x + i + 1] - sum_dot[y + i + 1][x] + sum_dot[y][x]
            if s == (i + 1)*(i + 1):
                ans = i + 1
                break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math

while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sum_dot = [[0 for i in range(n + 1)] for j in range(n + 1)]
    for y in range(n):
        for x in range(n):
            sum_dot[y + 1][x + 1] = sum_dot[y][x + 1] + inp[y][:x + 1].count(".")
    
    ans = 0
    for i in range(int(math.sqrt(sum_dot[-1][-1])))[::-1]:
        p = [(x, y) for y in range(n - i) for x in range(n - i)]
        for x, y in p:
            s = sum_dot[y + i + 1][x + i + 1] - sum_dot[y][x + i + 1] - sum_dot[y + i + 1][x] + sum_dot[y][x]
            if s == (i + 1)*(i + 1):
                ans = i + 1
                break
        else:
            continue
        break
    print(ans)



Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    inp = []
    for i in range(n):
        inp.append(list(input()))
    
    sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)]
    
    for y in range(n):
        for x in range(n):
            if inp[y][x] == ".":
                sq_max[y + 1][x + 1] = min(sq_max[y][x + 1], sq_max[y + 1][x], sq_max[y][x]) + 1
            else:
                sq_max[y + 1][x + 1] = 0
    ans = max(map(max, sq_max))
    print(ans)