Buggy python submission (verdict: Time Limit Exceeded):
H,W=map(int,input().split())
S=[]
for i in range(H):
    s=input()
    S.append(s)
 
Gh=[[0]*W for i in range(H)]
for i in range(H):
    tmp=0
    s=0
    j=0
    while(j!=W):
        if S[i][j]=="#":
            Gh[i][j]==0
            for k in range(s,j):
                Gh[i][k]=tmp
            s=j+1
            j+=1
            tmp=0
        else:
            tmp+=1
            j+=1
    if s!=j:
        for k in range(s,j):
            Gh[i][k]=tmp
Gv=[[0]*W for i in range(H)]
for j in range(W):
    tmp=0
    s=0
    i=0
    while(i!=H):
        if S[i][j]=="#":
            Gv[i][j]==0
            for k in range(s,i):
                Gv[k][j]=tmp
            s=i+1
            i+=1
            tmp=0
        else:
            tmp+=1
            i+=1
    if s!=i:
        for k in range(s,i):
            Gv[k][j]=tmp
ans=0
for i in range(H):
    for j in range(W):
        ans=max(ans,Gh[i][j]+Gv[i][j]-1)
print(ans)

Fixed submission:
H,W=map(int,input().split())
S=[]
for i in range(H):
    s=input()
    S.append(s)

Gh=[[0]*W for i in range(H)]
for i in range(H):
    tmp=0
    s=0
    j=0
    while(j!=W):
        if S[i][j]=="#":
            Gh[i][j]==0
            for k in range(s,j):
                Gh[i][k]=tmp
            s=j+1
            j+=1
            tmp=0
        else:
            tmp+=1
            j+=1
    if s!=j:
        for k in range(s,j):
            Gh[i][k]=tmp
Gv=[[0]*W for i in range(H)]
for j in range(W):
    tmp=0
    s=0
    i=0
    while(i!=H):
        if S[i][j]=="#":
            Gv[i][j]==0
            for k in range(s,i):
                Gv[k][j]=tmp
            s=i+1
            i+=1
            tmp=0
        else:
            tmp+=1
            i+=1
    if s!=i:
        for k in range(s,i):
            Gv[k][j]=tmp
ans=0
for i in range(H):
    for j in range(W):
        ans=max(ans,Gh[i][j]+Gv[i][j]-1)
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
h, w = map(int, input().split())
S = []
for i in range(h):
    S.append(input())
 
sw = []
 
for i in range(h):
    c = []
    for j in range(w):
        if S[i][j] == '#':
            c.append(j)
    c.append(w)
    k = []
    p = c[0]
    k += [p] * p
    k += [0]
    for j in range(1, len(c)):
        p = c[j] - c[j-1] - 1
        k += [p] * p
        k += [0]
    sw.append(k[0:-1])
 
sh =[]
 
for i in range(w):
    c = []
    for j in range(h):
        if S[j][i] == '#':
            c.append(j)
    c.append(h)
    k = []
    p = c[0]
    k += [p] * p
    k += [0]
    for j in range(1, len(c)):
        p = c[j] - c[j-1] - 1
        k += [p] * p
        k += [0]
    sh.append(k[0:-1])
 
sw = np.array(sw)
sh = np.array(sh)
sh = sh.T
 
x = sw + sh
 
print(np.amax(x) - 1)

Fixed submission:
H,W=map(int,input().split())
S=[]
for i in range(H):
    s=input()
    S.append(s)

Gh=[[0]*W for i in range(H)]
for i in range(H):
    tmp=0
    s=0
    j=0
    while(j!=W):
        if S[i][j]=="#":
            Gh[i][j]==0
            for k in range(s,j):
                Gh[i][k]=tmp
            s=j+1
            j+=1
            tmp=0
        else:
            tmp+=1
            j+=1
    if s!=j:
        for k in range(s,j):
            Gh[i][k]=tmp
Gv=[[0]*W for i in range(H)]
for j in range(W):
    tmp=0
    s=0
    i=0
    while(i!=H):
        if S[i][j]=="#":
            Gv[i][j]==0
            for k in range(s,i):
                Gv[k][j]=tmp
            s=i+1
            i+=1
            tmp=0
        else:
            tmp+=1
            i+=1
    if s!=i:
        for k in range(s,i):
            Gv[k][j]=tmp
ans=0
for i in range(H):
    for j in range(W):
        ans=max(ans,Gh[i][j]+Gv[i][j]-1)
print(ans)