Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = map(int, input().split(' '))

S = [input() + '#' for _ in range(H)]
S.append('#' * (W + 1))

rows = np.zeros(shape=(H, W), dtype=np.int64)
cols = np.zeros(shape=(W, H), dtype=np.int64)

for y in range(H):
    cont = 0
    for x in range(W + 1):
        if S[y][x] == '.':
            cont += 1
        else:
            rows[y][x - cont:x] = cont
            cont = 0

for x in range(W):
    cont = 0
    for y in range(H + 1):
        if S[y][x] == '.':
            cont += 1
        else:
            cols[x][y - cont:y] = cont
            cont = 0

print(np.max(rows + cols.T) - 1)


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

S = [input() for _ in range(H)]

rows = []
cols = []

for y in range(H):
    cont = 0
    row = []
    for x in range(W):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                row.append(cont)
            row.append(0)
            cont = 0
    for _ in range(cont):
        row.append(cont)
    rows.append(row)

for x in range(W):
    cont = 0
    col = []
    for y in range(H):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                col.append(cont)
            col.append(0)
            cont = 0
    for _ in range(cont):
        col.append(cont)
    cols.append(col)

ans = 0
for y in range(H):
    for x in range(W):
        if S[y][x] == '.':
            ans = max(ans, rows[y][x] + cols[x][y] - 1)

print(ans)

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

S = [input() for _ in range(H)]

rows = []
cols = []

for y in range(H):
    cont = 0
    row = []
    for x in range(W):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                row.append(cont)
            row.append(0)
            cont = 0
    for _ in range(cont):
        row.append(cont)
    rows.append(row)

for x in range(W):
    cont = 0
    col = []
    for y in range(H):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                col.append(cont)
            col.append(0)
            cont = 0
    for _ in range(cont):
        col.append(cont)
    cols.append(col)

ans = 0
for y in range(H):
    for x in range(W):
        if S[y][x] == '.':
            ans = max(ans, rows[y][x] + cols[x][y] - 1)

print(ans)


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

S = [input() for _ in range(H)]

rows = []
cols = []

for y in range(H):
    cont = 0
    row = []
    for x in range(W):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                row.append(cont)
            row.append(0)
            cont = 0
    for _ in range(cont):
        row.append(cont)
    rows.append(row)

for x in range(W):
    cont = 0
    col = []
    for y in range(H):
        if S[y][x] == '.':
            cont += 1
        else:
            for _ in range(cont):
                col.append(cont)
            col.append(0)
            cont = 0
    for _ in range(cont):
        col.append(cont)
    cols.append(col)

ans = 0
for y in range(H):
    for x in range(W):
        if S[y][x] == '.':
            ans = max(ans, rows[y][x] + cols[x][y] - 1)

print(ans)