Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
import numpy as np
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = np.zeros(H * W).reshape(H, W)
ans = np.zeros(H * W).reshape(H, W)

for h in range(H):
    s = [0 if i == '.' else -1 for i in input().strip()]
    S[h] = np.array(s)

for i, s in enumerate(S):
    c = 0
    q = deque([])
    for k, j in enumerate(s):
        if j == 0:
            c += 1
            q.append(k)
            continue
        for qq in q:
            ans[i, qq] = c
        q = deque([])
        c = 0
    else:
        for qq in q:
            ans[i, qq] = c
 
ans_max = 0
for w in range(W):
    c = 0
    q = []
    for i, s in enumerate(S):
        if s[w] == 0:
            c += 1
            q.append(i)
            continue
        for qq in q:
            ans[qq, w] += c
            ans_max = max(ans_max, ans[qq, w])
        q = []
        c = 0
    else:
        for qq in q:
            ans[qq, w] += c
            ans_max = max(ans_max, ans[qq, w])
        q = []
        c = 0

print(int(ans_max-1))

Fixed submission:
import sys
from collections import deque
import numpy as np
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
u = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
d = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
l = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
r = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)

for h in range(H):
    s = [1 if i == '.' else 0 for i in input().strip()]
    S[h + 1] = np.array([0] + s + [0])

for h in range(1, H + 1):
    u[h] = (u[h-1] + 1) * S[h]
    d[H+1-h] = (d[H+2-h] + 1) * S[H+1-h]

for w in range(1, W + 1):
    l[:, w] = (l[:, w-1] + 1) * S[:, w]
    r[:, W+1-w] = (r[:, W+2-w] + 1) * S[:, W+1-w]

ans = u+d+l+r
print(int(ans.max()-3))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = [0 for _ in range(H)]
ans = [[0] * W for h in range(H)]

for h in range(H):
    S[h] = list(input().strip())

for i, s in enumerate(S):
    c = 0
    q = deque([])
    for k, j in enumerate(s):
        if j == '.':
            c += 1
            q.append(k)
            continue
        for qq in q:
            ans[i][qq] = c
        q = deque([])
        c = 0
    else:
        for qq in q:
            ans[i][qq] = c

ans_max = 0
for w in range(W):
    c = 0
    q = []
    for i, s in enumerate(S):
        if s[w] == '.':
            c += 1
            q.append(i)
            continue
        for qq in q:
            ans[qq][w] += c
            ans_max = max(ans_max, ans[qq][w])
        q = []
        c = 0
    else:
        for qq in q:
            ans[qq][w] += c
            ans_max = max(ans_max, ans[qq][w])
        q = []
        c = 0

print(ans_max-1)

Fixed submission:
import sys
from collections import deque
import numpy as np
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
u = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
d = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
l = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
r = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)

for h in range(H):
    s = [1 if i == '.' else 0 for i in input().strip()]
    S[h + 1] = np.array([0] + s + [0])

for h in range(1, H + 1):
    u[h] = (u[h-1] + 1) * S[h]
    d[H+1-h] = (d[H+2-h] + 1) * S[H+1-h]

for w in range(1, W + 1):
    l[:, w] = (l[:, w-1] + 1) * S[:, w]
    r[:, W+1-w] = (r[:, W+2-w] + 1) * S[:, W+1-w]

ans = u+d+l+r
print(int(ans.max()-3))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = [0 for _ in range(H)]
ver = [[0] * W for h in range(H)]
hor = [[0] * W for h in range(H)]

for h in range(H):
    S[h] = list(input().strip())

for i, s in enumerate(S):
    c = 0
    q = []
    for k, j in enumerate(s):
        if j == '.':
            c += 1
            q.append(k)
            continue
        for qq in q:
            ver[i][qq] = c
        q = []
        c = 0
    else:
        for qq in q:
            ver[i][qq] = c

for w in range(W):
    c = 0
    q = []
    for i, s in enumerate(S):
        if s[w] == '.':
            c += 1
            q.append(i)
            continue
        for qq in q:
            hor[qq][w] = c
        q = []
        c = 0
    else:
        for qq in q:
            hor[qq][w] = c
        q = []
        c = 0

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, hor[h][w]+ver[h][w])
print(ans-1)

Fixed submission:
import sys
from collections import deque
import numpy as np
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
S = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
u = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
d = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
l = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)
r = np.zeros((H + 2) * (W + 2)).reshape(H + 2, W + 2)

for h in range(H):
    s = [1 if i == '.' else 0 for i in input().strip()]
    S[h + 1] = np.array([0] + s + [0])

for h in range(1, H + 1):
    u[h] = (u[h-1] + 1) * S[h]
    d[H+1-h] = (d[H+2-h] + 1) * S[H+1-h]

for w in range(1, W + 1):
    l[:, w] = (l[:, w-1] + 1) * S[:, w]
    r[:, W+1-w] = (r[:, W+2-w] + 1) * S[:, W+1-w]

ans = u+d+l+r
print(int(ans.max()-3))