Buggy python submission (verdict: Runtime Error):
import numpy as np
import bisect 

h, w = list(map(int, input().split()))
d = {".":0, "#":1}
ss = np.array([list(input()) for _ in range(h)])
ss = np.array([[d[x] for x in s] for s in ss])

ans = 0
ws = np.zeros((h, w))
hs = np.zeros((h, w))

i = 0
while i < h:
	j = 0
	while j < w:
		if ss[i, j] == 0:
			end = w
			for k in range(j + 1, w):
				if ss[i, k] == 1:
					end = k
					break
			ws[i, j:end] = end - j
			j = end + 1
		else:
			j += 1
	i += 1

j = 0
while j < w:
	i = 0
	while i < h:
		if ss[i, j] == 0:
			end = h
			for k in range(i + 1, h):
				if ss[k, j] == 1:
					end = k
					break
			hs[i:end, j] = end - i
			i = end + 1
		else:
			i += 1
	j += 1

# print(ss)
# print(ws)
# print(hs)
print(max(int(np.amax(ws + hs) - 1), 0))


Fixed submission:
import numpy as np

h, w = list(map(int, input().split()))
d = {".":1, "#":0}
ss = np.array([list(input()) for _ in range(h)]) == "."
ss_t = ss.transpose()

ls, rs, us, ds = [np.zeros((h, w), dtype=int) for _ in range(4)]

ls, rs = ls.transpose(), rs.transpose()

ls[0] = ss_t[0]
rs[w-1] = ss_t[w-1]
us[0] = ss[0]
ds[h-1] = ss[h-1]

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

for i in reversed(range(w - 1)):
	rs[i] = ss_t[i] * (rs[i + 1] + 1)

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

for i in reversed(range(h - 1)):
	ds[i] = ss[i] * (ds[i + 1] + 1)

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)
print(max(np.amax((ls.transpose() + rs.transpose() + us + ds) - 3), 0))

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

h, w = list(map(int, input().split()))
d = {".":1, "#":0}
ss = np.array([list(input()) for _ in range(h)])
ss = np.array([[d[x] for x in s] for s in ss])

ls, rs, us, ds = [np.zeros((h, w)) for _ in range(4)]

ls[:, 0] = ss[:, 0]
rs[:, w-1] = ss[:, w-1]
us[0, :] = ss[0, :]
ds[h-1, :] = ss[h-1, :]

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

for i in reversed(range(w - 1)):
	rs[:, i] = ss[:, i] * (rs[:, i + 1] + 1)

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

for i in reversed(range(h - 1)):
	ds[i, :] = ss[i, :] * (ds[i + 1, :] + 1)

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)
print(max(int(np.amax(ls + rs + us + ds) - 3), 0))


Fixed submission:
import numpy as np

h, w = list(map(int, input().split()))
d = {".":1, "#":0}
ss = np.array([list(input()) for _ in range(h)]) == "."
ss_t = ss.transpose()

ls, rs, us, ds = [np.zeros((h, w), dtype=int) for _ in range(4)]

ls, rs = ls.transpose(), rs.transpose()

ls[0] = ss_t[0]
rs[w-1] = ss_t[w-1]
us[0] = ss[0]
ds[h-1] = ss[h-1]

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

for i in reversed(range(w - 1)):
	rs[i] = ss_t[i] * (rs[i + 1] + 1)

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

for i in reversed(range(h - 1)):
	ds[i] = ss[i] * (ds[i + 1] + 1)

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)
print(max(np.amax((ls.transpose() + rs.transpose() + us + ds) - 3), 0))

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

h, w = list(map(int, input().split()))
d = {".":0, "#":1}
ss = np.array([list(input()) for _ in range(h)])
ss = np.array([[d[x] for x in s] for s in ss])

ans = 0
ls = np.zeros((h, w))
rs = np.zeros((h, w))
us = np.zeros((h, w))
ds = np.zeros((h, w))

for i in range(h):
	if ss[i, 0] == 0:
		ls[i, 0] = 1
	for j in range(1, w):
		if ss[i, j] == 0:
			ls[i, j] = ls[i, j - 1] + 1		

	if ss[i, w - 1] == 0:
		rs[i, w - 1] = 1
	for j in reversed(range(w - 1)):
		if ss[i, j] == 0:
			rs[i, j] = rs[i, j + 1] + 1

for j in range(w):
	if ss[0, j] == 0:
		us[0, j] = 1
	for i in range(1, h):
		if ss[i, j] == 0:
			us[i, j] = us[i - 1, j] + 1

	if ss[h - 1, j] == 0:
		ds[h - 1, j] = 1
	for i in reversed(range(h - 1)):
		if ss[i, j] == 0:
			ds[i, j] = ds[i + 1, j] + 1

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)

print(max(int(np.amax(ls + rs + us + ds) - 3), 0))


Fixed submission:
import numpy as np

h, w = list(map(int, input().split()))
d = {".":1, "#":0}
ss = np.array([list(input()) for _ in range(h)]) == "."
ss_t = ss.transpose()

ls, rs, us, ds = [np.zeros((h, w), dtype=int) for _ in range(4)]

ls, rs = ls.transpose(), rs.transpose()

ls[0] = ss_t[0]
rs[w-1] = ss_t[w-1]
us[0] = ss[0]
ds[h-1] = ss[h-1]

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

for i in reversed(range(w - 1)):
	rs[i] = ss_t[i] * (rs[i + 1] + 1)

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

for i in reversed(range(h - 1)):
	ds[i] = ss[i] * (ds[i + 1] + 1)

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)
print(max(np.amax((ls.transpose() + rs.transpose() + us + ds) - 3), 0))

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

h, w = list(map(int, input().split()))
d = {".":0, "#":1}
ss = np.array([list(input()) for _ in range(h)])
ss = np.array([[d[x] for x in s] for s in ss])

ans = 0
ws = np.zeros((h, w))
hs = np.zeros((h, w))

i = 0
while i < h:
	j = 0
	while j < w:
		if ss[i, j] == 0:
			end = w
			for k in range(j + 1, w):
				if ss[i, k] == 1:
					end = k
					break
			ws[i, j:end] = end - j
			j = end + 1
		else:
			j += 1
	i += 1

j = 0
while j < w:
	i = 0
	while i < h:
		if ss[i, j] == 0:
			end = h
			for k in range(i + 1, h):
				if ss[k, j] == 1:
					end = k
					break
			hs[i:end, j] = end - i
			i = end + 1
		else:
			i += 1
	j += 1

# print(ss)
# print(ws)
# print(hs)
print(max(int(np.amax(ws + hs) - 1), 0))


Fixed submission:
import numpy as np

h, w = list(map(int, input().split()))
d = {".":1, "#":0}
ss = np.array([list(input()) for _ in range(h)]) == "."
ss_t = ss.transpose()

ls, rs, us, ds = [np.zeros((h, w), dtype=int) for _ in range(4)]

ls, rs = ls.transpose(), rs.transpose()

ls[0] = ss_t[0]
rs[w-1] = ss_t[w-1]
us[0] = ss[0]
ds[h-1] = ss[h-1]

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

for i in reversed(range(w - 1)):
	rs[i] = ss_t[i] * (rs[i + 1] + 1)

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

for i in reversed(range(h - 1)):
	ds[i] = ss[i] * (ds[i + 1] + 1)

# print(ss)
# print(ls)
# print(rs)
# print(us)
# print(ds)
print(max(np.amax((ls.transpose() + rs.transpose() + us + ds) - 3), 0))