Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
h, w = map(int, input().split())
s = [input() for _ in range(h)]

hdots = [[0]*(w+1) for _ in range(h)]
for j in range(h):
    ndots = 0
    for i in range(1, w+1):
        if s[j][i-1] == '.':
            ndots += 1
        else:
            hdots[j][i-1] = ndots
            ndots = 0
    hdots[j][-1] = ndots if s[j][-1] == '.' else 0
    for i in range(w, 0, -1):
        if s[j][i-1] == '.':
            hdots[j][i] = ndots
        else:
            ndots = hdots[j][i-1]
vdots = [[0]*w for _ in range(h+1)]
for i in range(w):
    ndots = 0
    for j in range(1, h+1):
        if s[j-1][i] == '.':
            ndots += 1
        else:
            vdots[j-1][i] = ndots
            ndots = 0
    vdots[-1][i] = ndots if s[-1][i] == '.' else 0
    for j in range(h, 0, -1):
        if s[j-1][i] == '.':
            vdots[j][i] = ndots
        else:
            ndots = vdots[j-1][i]

ans = 0
for j in range(h):
    for i in range(w):
        nh, nv = hdots[j][i+1], vdots[j+1][i]
        if nh == 0 or nv == 0:
            continue
        ans = max(ans, nh+nv-1)
print(ans)


Fixed submission:
# Refered #5850116 submit
import numpy as np

h, w = map(int, input().split())
s = np.array([list(input()) for _ in range(h)]) == '.'

ups = np.zeros((h, w), dtype = int)
downs = np.zeros((h, w), dtype = int)
lefts = np.zeros((h, w), dtype = int)
rights = np.zeros((h, w), dtype = int)

for i in range(1, h):
    ups[i] = (ups[i-1]+1)*s[i-1]
for i in range(h-2, -1, -1):
    downs[i] = (downs[i+1]+1)*s[i+1]
for j in range(1, w):
    lefts[:, j] = (lefts[:, j-1]+1)*s[:, j-1]
for j in range(w-2, -1, -1):
    rights[:, j] = (rights[:, j+1]+1)*s[:, j+1]
counts = ups+downs+lefts+rights
ans = np.max(counts*s)+1
print(ans)

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

hdots = [[0]*(w+1) for _ in range(h)]
for j in range(h):
    ndots = 0
    for i in range(1, w+1):
        if s[j][i-1] == '.':
            ndots += 1
        else:
            hdots[j][i-1] = ndots
            ndots = 0
    hdots[j][-1] = ndots if s[j][-1] == '.' else 0
    for i in range(w, 0, -1):
        if s[j][i-1] == '.':
            hdots[j][i] = ndots
        else:
            ndots = hdots[j][i-1]
vdots = [[0]*w for _ in range(h+1)]
for i in range(w):
    ndots = 0
    for j in range(1, h+1):
        if s[j-1][i] == '.':
            ndots += 1
        else:
            vdots[j-1][i] = ndots
            ndots = 0
    vdots[-1][i] = ndots if s[-1][i] == '.' else 0
    for j in range(h, 0, -1):
        if s[j-1][i] == '.':
            vdots[j][i] = ndots
        else:
            ndots = vdots[j-1][i]

ans = 0
for j in range(h):
    for i in range(w):
        nh, nv = hdots[j][i+1], vdots[j+1][i]
        if nh == 0 or nv == 0:
            continue
        ans = max(ans, nh+nv-1)
print(ans)


Fixed submission:
# Refered #5850116 submit
import numpy as np

h, w = map(int, input().split())
s = np.array([list(input()) for _ in range(h)]) == '.'

ups = np.zeros((h, w), dtype = int)
downs = np.zeros((h, w), dtype = int)
lefts = np.zeros((h, w), dtype = int)
rights = np.zeros((h, w), dtype = int)

for i in range(1, h):
    ups[i] = (ups[i-1]+1)*s[i-1]
for i in range(h-2, -1, -1):
    downs[i] = (downs[i+1]+1)*s[i+1]
for j in range(1, w):
    lefts[:, j] = (lefts[:, j-1]+1)*s[:, j-1]
for j in range(w-2, -1, -1):
    rights[:, j] = (rights[:, j+1]+1)*s[:, j+1]
counts = ups+downs+lefts+rights
ans = np.max(counts*s)+1
print(ans)