Buggy python submission (verdict: Time Limit Exceeded):
h,w=map(int,input().split())
ans=[[-3]*w for _ in range(h)]
s=[input() for _ in range(h)]
for i in range(h):
    tmp=0
    for j in range(w):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for j in range(w-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

for j in range(w):
    tmp=0
    for i in range(h):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for i in range(h-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

print(max( max(ans[i]) for i in range(h) ))

Fixed submission:
h,w=map(int,input().split())
ans=[[-3]*w for _ in range(h)]
s=[input() for _ in range(h)]
for i in range(h):
    tmp=0
    for j in range(w):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for j in range(w-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

for j in range(w):
    tmp=0
    for i in range(h):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for i in range(h-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

print(max( max(ans[i]) for i in range(h) ))

Buggy python submission (verdict: Runtime Error):
def chkp(i,j):
	tmp=j+1
	count=1
	while tmp<W and s[i][tmp]==".":
		count+=1
		tmp+=1
	return count

def chkv(i,j):
	tmp=i+1
	count=1
	while tmp<H and s[tmp][j]==".":
		count+=1
		tmp+=1
	return count

H,W=map(int,input().split())
s=[input() for i in range(H)]

p=[[0 for j in range(W)] for i in range(H)]
v=[[0 for j in range(W)] for i in range(H)]

for i in range(H):
	if W==1:
		if s[i][j]==".": p[i][0]=1
	else:
		if s[i][0]==".": p[i][0]=chkp(i,0)
		for j in range(1,W):
			if s[i][j]==".":
				if s[i][j-1]==".": p[i][j]=p[i][j-1]
				else: p[i][j]=chkp(i,j)

for j in range(W):
	if H==1:
		if s[i][j]==".": v[0][j]=1
	else:
		if s[0][j]==".": v[0][j]=chkv(0,j)
		for i in range(1,H):
			if s[i][j]==".":
				if s[i-1][j]==".": v[i][j]=v[i-1][j]
				else: v[i][j]=chkv(i,j)

print(max( max(v[i][j]+p[i][j] for j in range(W)) for i in range(H)  ))

Fixed submission:
h,w=map(int,input().split())
ans=[[-3]*w for _ in range(h)]
s=[input() for _ in range(h)]
for i in range(h):
    tmp=0
    for j in range(w):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for j in range(w-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

for j in range(w):
    tmp=0
    for i in range(h):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for i in range(h-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

print(max( max(ans[i]) for i in range(h) ))

Buggy python submission (verdict: Runtime Error):
def chkp(i,j):
	tmp=j+1
	count=1
	while tmp<W and s[i][tmp]==".":
		count+=1
		tmp+=1
	return count

def chkv(i,j):
	tmp=i+1
	count=1
	while tmp<H and s[tmp][j]==".":
		count+=1
		tmp+=1
	return count

H,W=map(int,input().split())
s=[input() for i in range(H)]

p=[[0 for j in range(W)] for i in range(H)]
v=[[0 for j in range(W)] for i in range(H)]

for i in range(H):
	if W==1:
		if s[i][j]==".": p[i][0]=1
	else:
		if s[i][0]==".": p[i][0]=chkp(i,0)
		for j in range(1,W):
			if s[i][j]==".":
				if s[i][j-1]==".": p[i][j]=p[i][j-1]
				else: p[i][j]=chkp(i,j)

for j in range(W):
	if H==1:
		if s[i][j]==".": v[0][j]=1
	else:
		if s[0][j]==".": v[0][j]=chkv(0,j)
		for i in range(1,H):
			if s[i][j]==".":
				if s[i-1][j]==".": v[i][j]=v[i-1][j]
				else: v[i][j]=chkv(i,j)
					
print(max( max(v[i][j]+p[i][j] for j in range(W)) for i in range(H)  )-1)

Fixed submission:
h,w=map(int,input().split())
ans=[[-3]*w for _ in range(h)]
s=[input() for _ in range(h)]
for i in range(h):
    tmp=0
    for j in range(w):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for j in range(w-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

for j in range(w):
    tmp=0
    for i in range(h):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp
    tmp=0
    for i in range(h-1,-1,-1):
        if s[i][j]=="#": tmp=0
        else: tmp+=1
        ans[i][j]+=tmp

print(max( max(ans[i]) for i in range(h) ))