Buggy python submission (verdict: Time Limit Exceeded):
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)

a = np.zeros((h,w), dtype=np.int)
#print(yoko)
b = np.zeros((h,w), dtype=np.int)
for i in range(h):
    for j in range(w):
        if grid[i][j]=='#':
            b[i][j] = 0
        else:
            b[i][j] = 1

for i in range(h):
    temp = 0
    for j in range(w):
        temp = (temp + 1)*b[i][j]
        a[i][j] += temp

for i in range(h):
    temp = 0
    for j in range(w-1,-1,-1):
        temp = (temp + 1)*b[i][j]
        a[i][j] += temp

for j in range(w):
    temp = 0
    for i in range(h):
        temp = (temp + 1)*b[i][j]
        a[i][j] += temp

for j in range(w):
    temp = 0
    for i in range(h-1,-1,-1):
        temp = (temp + 1)*b[i][j]
        a[i][j] += temp

answer=3
for i in range(h):
    for j in range(w):
        answer=max(a[i][j],answer)
#print(a)
print(answer-3)



Fixed submission:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)
b = np.array(grid)
b = np.where(b == ".", 1, 0)

a1 = np.zeros((h,w), dtype=np.int)
a2 = np.zeros((h,w), dtype=np.int)
a3 = np.zeros((h,w), dtype=np.int)
a4 = np.zeros((h,w), dtype=np.int)
#print(b)

for i in range(1,h):
    a1[i] += (a1[i-1]+1)*b[i-1]

for i in range(h-2,-1,-1):
    a2[i] += (a2[i+1]+1)*b[i+1]

for i in range(1,w):
    a3[:, i] += (a3[:, i-1]+1)*b[:, i-1]

for i in range(w-2,-1,-1):
    a4[:, i] += (a4[:, i+1]+1)*b[:, i+1]

#print(a1,a2,a3,a4)

answer = ( (a1+a2+a3+a4)*b ).max()

print(answer+1)

Buggy python submission (verdict: Time Limit Exceeded):
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)

a = np.zeros((h,w), dtype=np.int)
#print(yoko)
b = np.zeros((h,w), dtype=np.int)
for i in range(h):
    for j in range(w):
        if grid[i][j]=='#':
            b[i][j] = 1
        else:
            b[i][j] = 0

for i in range(h):
    temp = 0
    for j in range(w):
        if b[i][j]==1:
            temp=0
        else:
            temp += 1
            a[i][j] += temp

for i in range(h):
    temp = 0
    for j in range(w-1,-1,-1):
        if b[i][j]==1:
            temp=0
        else:
            temp += 1
            a[i][j] += temp
#print(a)
for j in range(w):
    temp = 0
    for i in range(h):
        if b[i][j]==1:
            temp=0
        else:
            temp += 1
            a[i][j] += temp

for j in range(w):
    temp = 0
    for i in range(h-1,-1,-1):
        if b[i][j]==1:
            temp=0
        else:
            temp += 1
            a[i][j] += temp
answer=3
for i in range(h):
    for j in range(w):
        answer=max(a[i][j],answer)
#print(a)
print(answer-3)



Fixed submission:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)
b = np.array(grid)
b = np.where(b == ".", 1, 0)

a1 = np.zeros((h,w), dtype=np.int)
a2 = np.zeros((h,w), dtype=np.int)
a3 = np.zeros((h,w), dtype=np.int)
a4 = np.zeros((h,w), dtype=np.int)
#print(b)

for i in range(1,h):
    a1[i] += (a1[i-1]+1)*b[i-1]

for i in range(h-2,-1,-1):
    a2[i] += (a2[i+1]+1)*b[i+1]

for i in range(1,w):
    a3[:, i] += (a3[:, i-1]+1)*b[:, i-1]

for i in range(w-2,-1,-1):
    a4[:, i] += (a4[:, i+1]+1)*b[:, i+1]

#print(a1,a2,a3,a4)

answer = ( (a1+a2+a3+a4)*b ).max()

print(answer+1)

Buggy python submission (verdict: Time Limit Exceeded):
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)

a = np.zeros((h,w), dtype=np.int)
#print(yoko)

for i in range(h):
    temp = 0
    for j in range(w):
        if grid[i][j]=='#':
            temp=0
        else:
            temp += 1
            a[i][j] += temp

for i in range(h):
    temp = 0
    for j in range(w-1,-1,-1):
        if grid[i][j]=='#':
            temp=0
        else:
            temp += 1
            a[i][j] += temp
#print(a)
for j in range(w):
    temp = 0
    for i in range(h):
        if grid[i][j]=='#':
            temp=0
        else:
            temp += 1
            a[i][j] += temp

for j in range(w):
    temp = 0
    for i in range(h-1,-1,-1):
        if grid[i][j]=='#':
            temp=0
        else:
            temp += 1
            a[i][j] += temp
answer=3
for i in range(h):
    for j in range(w):
        answer=max(a[i][j],answer)
#print(a)
print(answer-3)



Fixed submission:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
h,w = (int(i) for i in input().split())  

# 2次元配列
grid = []
for i in range(h):
    array = list(input())
    grid.append(array)
b = np.array(grid)
b = np.where(b == ".", 1, 0)

a1 = np.zeros((h,w), dtype=np.int)
a2 = np.zeros((h,w), dtype=np.int)
a3 = np.zeros((h,w), dtype=np.int)
a4 = np.zeros((h,w), dtype=np.int)
#print(b)

for i in range(1,h):
    a1[i] += (a1[i-1]+1)*b[i-1]

for i in range(h-2,-1,-1):
    a2[i] += (a2[i+1]+1)*b[i+1]

for i in range(1,w):
    a3[:, i] += (a3[:, i-1]+1)*b[:, i-1]

for i in range(w-2,-1,-1):
    a4[:, i] += (a4[:, i+1]+1)*b[:, i+1]

#print(a1,a2,a3,a4)

answer = ( (a1+a2+a3+a4)*b ).max()

print(answer+1)