Buggy python submission (verdict: Time Limit Exceeded):
h, w = map(int, input().split())
s = [list(map(str, input().rstrip())) for _ in range(h)]

score_h = [[0] * w for _ in range(h)]
score_w = [[0] * h for _ in range(w)]

for i in range(h):
    tmp = 0
    for j in range(w):
        if s[i][j] == "#":
            tmp = 0
            continue
        else:
            tmp += 1
            score_h[i][j] = tmp

for i in range(h):
    for j in range(w - 1, 0, -1):
        if score_h[i][j] == 0 or score_h[i][j - 1] == 0:
            continue
        else:
            score_h[i][j - 1] = score_h[i][j]

sT = list(zip(*s))
sT = [list(x) for x in sT]

for i in range(w):
    tmp = 0
    for j in range(h):
        if sT[i][j] == "#":
            tmp = 0
            continue
        else:
            tmp += 1
            score_w[i][j] = tmp

for i in range(w):
    for j in range(h - 1, 0, -1):
        if score_w[i][j] == 0 or score_w[i][j - 1] == 0:
            continue
        else:
            score_w[i][j - 1] = score_w[i][j]

score_w = list(zip(*score_w))
score_w = [list(x) for x in score_w]

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, score_h[i][j] + score_w[i][j] - 1)

print(ans)

Fixed submission:
import numpy as np
h, w = map(int, input().split())
arr = np.array([list(input()) for _ in range(h)]) == "."

l = np.zeros((h, w), dtype=int)
r = np.zeros((h, w), dtype=int)
u = np.zeros((h, w), dtype=int)
d = np.zeros((h, w), dtype=int)

for i in range(h):
    u[i] = (u[i - 1] + 1) * arr[i]
    d[- i - 1] = (d[- i] + 1) * arr[- i - 1]

for j in range(w):
    l[:, j] = (l[:, j-1] + 1) * arr[:, j]
    r[:, - j - 1] = (r[:, - j] + 1) * arr[:, - j - 1]

print(np.max(u + d + l + r) - 3)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
h, w = map(int, input().split())
s = np.array([list(map(str, input().rstrip())) for _ in range(h)])

s = np.array([x == "." for x in s])

score_h = np.zeros([h, w], int)
score_w = np.zeros([w, h], int)

for i in range(h):
    tmp = 0
    for j in range(w):
        if not s[i, j]:
            tmp = 0
            continue
        else:
            tmp += 1
            score_h[i, j] = tmp

for i in range(h):
    for j in range(w - 1, 0, -1):
        if score_h[i, j] == 0 or score_h[i, j - 1] == 0:
            continue
        else:
            score_h[i, j - 1] = score_h[i, j]

s = s.T

for i in range(w):
    tmp = 0
    for j in range(h):
        if not s[i, j]:
            tmp = 0
            continue
        else:
            tmp += 1
            score_w[i, j] = tmp

for i in range(w):
    for j in range(h - 1, 0, -1):
        if score_w[i, j] == 0 or score_w[i, j - 1] == 0:
            continue
        else:
            score_w[i, j - 1] = score_w[i, j]

score_w = score_w.T

print((score_h + score_w - 1).max())

Fixed submission:
import numpy as np
h, w = map(int, input().split())
arr = np.array([list(input()) for _ in range(h)]) == "."

l = np.zeros((h, w), dtype=int)
r = np.zeros((h, w), dtype=int)
u = np.zeros((h, w), dtype=int)
d = np.zeros((h, w), dtype=int)

for i in range(h):
    u[i] = (u[i - 1] + 1) * arr[i]
    d[- i - 1] = (d[- i] + 1) * arr[- i - 1]

for j in range(w):
    l[:, j] = (l[:, j-1] + 1) * arr[:, j]
    r[:, - j - 1] = (r[:, - j] + 1) * arr[:, - j - 1]

print(np.max(u + d + l + r) - 3)