Buggy python submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
for h in range(1, H):
    U[h] = (U[h - 1] + 1) * S[h - 1]
for h in reversed(range(H - 1)):
    D[h] = (D[h + 1] + 1) * S[h + 1]
for w in range(1, W):
    L[:, w] = (L[:, w - 1] + 1) * S[:, w - 1]
for w in reversed(range(W - 1)):
    R[:, w] = (R[:, w + 1] + 1) * S[:, w + 1]
print(max((U+D+L+R) * S) + 1)

Fixed submission:
import numpy as np
H , W = list(map(int, input().split()))
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
for h in range(1, H):
    U[h] = (U[h - 1] + 1) * S[h - 1]
for h in reversed(range(H - 1)):
    D[h] = (D[h + 1] + 1) * S[h + 1]
for w in range(1, W):
    L[:, w] = (L[:, w - 1] + 1) * S[:, w - 1]
for w in reversed(range(W - 1)):
    R[:, w] = (R[:, w + 1] + 1) * S[:, w + 1]
print(np.max((U+D+L+R) * S) + 1)

Buggy python submission (verdict: Runtime Error):
import numpy as np
H, W = map(int,input().split())
S = []
for h in range(H):
   S.append(input())
def calc(LR,RL,H,W,S):
   for h in range(H):
       for w in range(W):
           if S[h][w]==".":
               LR[h+1][w+1] = LR[h+1][w] + 1
           else:
               LR[h+1][w+1] = 0
           if S[h][W-w-1]==".":
               RL[h+1][W-w] = RL[h+1][W-w+1] + 1
           else:
               RL[h+1][W-w] = 0
   return LR, RL
LR = np.zeros((H+2,W+2)).astype(np.int)
RL = np.zeros((H+2,W+2)).astype(np.int)
UD = np.zeros((H+2,W+2)).astype(np.int)
DU = np.zeros((H+2,W+2)).astype(np.int)
LR, RL = calc(LR,RL,H,W,S)
S2 = ["" for i in range(len(S[0]))]
for i in range(len(S[0])):
   for j in range(len(S)):
       S2[i]+=(S[j][i])

UD, DU = calc(UD.T,DU.T,W,H,S2)
mx = 0
for h in range(H):
   for w in range(W):
       p = 0
       if (S[h][w]=="."):
           p = LR[h+1][w]+RL[h+1][w+2] + UD.T[h][w+1]+DU.T[h+2][w+1] + 1
           mx = max(mx,p)
print (mx)

Fixed submission:
import numpy as np
H , W = list(map(int, input().split()))
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
for h in range(1, H):
    U[h] = (U[h - 1] + 1) * S[h - 1]
for h in reversed(range(H - 1)):
    D[h] = (D[h + 1] + 1) * S[h + 1]
for w in range(1, W):
    L[:, w] = (L[:, w - 1] + 1) * S[:, w - 1]
for w in reversed(range(W - 1)):
    R[:, w] = (R[:, w + 1] + 1) * S[:, w + 1]
print(np.max((U+D+L+R) * S) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
H, W = map(int,input().split())
S = []
for h in range(H):
   S.append(input())
def calc(LR,RL,H,W,S):
   for h in range(H):
       for w in range(W):
           if S[h][w]==".":
               LR[h+1][w+1] = LR[h+1][w] + 1
           else:
               LR[h+1][w+1] = 0
           if S[h][W-w-1]==".":
               RL[h+1][W-w] = RL[h+1][W-w+1] + 1
           else:
               RL[h+1][W-w] = 0
   return LR, RL
LR = np.zeros((H+2,W+2)).astype(np.int)
RL = np.zeros((H+2,W+2)).astype(np.int)
UD = np.zeros((H+2,W+2)).astype(np.int)
DU = np.zeros((H+2,W+2)).astype(np.int)
LR, RL = calc(LR,RL,H,W,S)
S2 = ["" for i in range(len(S[0]))]
for i in range(len(S[0])):
   for j in range(len(S)):
       S2[i]+=(S[j][i])

UD, DU = calc(UD.T,DU.T,W,H,S2)
mx = 0
for h in range(H):
   for w in range(W):
       p = 0
       if (S[h][w]=="."):
           p = LR[h+1][w]+RL[h+1][w+2] + UD.T[h][w+1]+DU.T[h+2][w+1] + 1
           mx = max(mx,p)
print (mx)

Fixed submission:
import numpy as np
H , W = list(map(int, input().split()))
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
for h in range(1, H):
    U[h] = (U[h - 1] + 1) * S[h - 1]
for h in reversed(range(H - 1)):
    D[h] = (D[h + 1] + 1) * S[h + 1]
for w in range(1, W):
    L[:, w] = (L[:, w - 1] + 1) * S[:, w - 1]
for w in reversed(range(W - 1)):
    R[:, w] = (R[:, w + 1] + 1) * S[:, w + 1]
print(np.max((U+D+L+R) * S) + 1)