Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())

room = [[True if c == "." else False for c in input()] for _ in range(H)]

count = []

for i in range(H):
    count.append([0] * W)


def check(row,col):
    px = col
    py = row
    while py >= 0:
        if not room[py][px]:
            break
        count[py][px] += 1
        py -= 1
    py = row + 1
    while py < H:
        if not room[py][px]:
            break
        count[py][px] += 1
        py += 1
    py = row

    while px >= 0:
        if not room[py][px]:
            break
        count[py][px] += 1
        px -= 1
    px = col + 1
    while px < W:
        if not room[py][px]:
            break
        count[py][px] += 1
        px += 1


for row in range(H):
    for col in range(W):
        if room[row][col]:
            check(row, col)

ans = 0

for rowline in count:
    ans = max(max(rowline), ans)

print((ans - 1))

Fixed submission:
H, W = map(int, input().split())

room = [[True if c == "." else False for c in input()] for _ in range(H)]

count = []

for i in range(H):
    count.append([0] * W)

for row in range(H):
    start = 0
    for col in range(W):
        if not room[row][col]:
            if col != 0:
                plus = col - start
                for i in range(start, col):
                    count[row][i] += plus
            start = col + 1
    if room[row][W - 1]:
        plus = W - start
        for i in range(start, W):
            count [row][i] += plus

for col in range(W):
    start = 0
    for row in range(H):
        if not room[row][col]:
            if row != 0:
                plus = row - start
                for i in range(start, row):
                    count[i][col] += plus
            start = row + 1
    if room[H - 1][col]:
        plus = H - start
        for i in range(start, H):
            count[i][col] += plus

ans = 0

for rowline in count:
    ans = max(max(rowline), ans)

print((ans - 1))

Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())

room = [[True if c == "." else False for c in input()] for _ in range(H)]

count = []

for i in range(H):
    count.append([0] * W)


def check(row,col):
    px = col
    py = row
    while py >= 0:
        if not room[py][px]:
            break
        count[py][px] += 1
        py -= 1
    py = row + 1
    while py < H:
        if not room[py][px]:
            break
        count[py][px] += 1
        py += 1
    py = row

    while px >= 0:
        if not room[py][px]:
            break
        count[py][px] += 1
        px -= 1
    px = col + 1
    while px < W:
        if not room[py][px]:
            break
        count[py][px] += 1
        px += 1


for row in range(H):
    for col in range(W):
        if room[row][col]:
            check(row, col)

ans = 0

for rowline in count:
    ans = max(max(rowline), ans)

print((ans - 1))

Fixed submission:
H, W = map(int, input().split())

room = [[True if c == "." else False for c in input()] for _ in range(H)]

count = []

for i in range(H):
    count.append([0] * W)

for row in range(H):
    start = 0
    for col in range(W):
        if not room[row][col]:
            if col != 0:
                plus = col - start
                for i in range(start, col):
                    count[row][i] += plus
            start = col + 1
    if room[row][W - 1]:
        plus = W - start
        for i in range(start, W):
            count [row][i] += plus

for col in range(W):
    start = 0
    for row in range(H):
        if not room[row][col]:
            if row != 0:
                plus = row - start
                for i in range(start, row):
                    count[i][col] += plus
            start = row + 1
    if room[H - 1][col]:
        plus = H - start
        for i in range(start, H):
            count[i][col] += plus

ans = 0

for rowline in count:
    ans = max(max(rowline), ans)

print((ans - 1))