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

H,W = map(int,input().split())
grid = np.zeros((H+2,W+2), dtype=bool)
grid[1:-1, 1:-1] = tuple(tuple(map(lambda c: c != '#', input())) for _ in range(H))

scores = np.zeros((H+2, W+2), dtype=int)

for i in range(1, H+1):
    s = 0
    for j in range(1,W+1):
        if grid[i,j]:
            scores[i,j] += s
            s += 1
        else:
            s = 0

for i in range(1, H+1):
    s = 0
    for j in reversed(range(1,W+1)):
        if grid[i,j]:
            scores[i,j] += s
            s += 1
        else:
            s = 0

for j in range(1, W+1):
    s = 0
    for i in range(1,H+1):
        if grid[i,j]:
            scores[i,j] += s
            s += 1
        else:
            s = 0

for j in range(1, W+1):
    s = 0
    for i in reversed(range(1,H+1)):
        if grid[i,j]:
            scores[i,j] += s
            s += 1
        else:
            s = 0


print(scores.max()+1)

Fixed submission:
from itertools import chain

H,W = map(int,input().split())
grid = tuple(tuple(map(lambda c: c != '#', input())) for _ in range(H))

scores = [[0]*W for _ in range(H)]

for i in range(H):
    s = 0
    for j in range(W):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for i in range(H):
    s = 0
    for j in reversed(range(W)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in range(H):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in reversed(range(H)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0


print(1 + max(chain.from_iterable(scores)))

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

H,W = map(int,input().split())
grid = np.zeros((H+2,W+2), dtype=bool)
grid[1:-1, 1:-1] = tuple(tuple(map(lambda c: c != '#', input())) for _ in range(H))
grid = grid.tolist()

scores = [[0]*(W+2) for _ in range(H+2)]

for i in range(1, H+1):
    s = 0
    for j in range(1,W+1):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for i in range(1, H+1):
    s = 0
    for j in reversed(range(1,W+1)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(1, W+1):
    s = 0
    for i in range(1,H+1):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(1, W+1):
    s = 0
    for i in reversed(range(1,H+1)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0


print(np.array(scores).max()+1)

Fixed submission:
from itertools import chain

H,W = map(int,input().split())
grid = tuple(tuple(map(lambda c: c != '#', input())) for _ in range(H))

scores = [[0]*W for _ in range(H)]

for i in range(H):
    s = 0
    for j in range(W):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for i in range(H):
    s = 0
    for j in reversed(range(W)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in range(H):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in reversed(range(H)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0


print(1 + max(chain.from_iterable(scores)))