Buggy python submission (verdict: Time Limit Exceeded):
H,W=map(int,input().split())
map_matrix=[]
calc_matrix=[]
for i in range(H):
  line=[True if s=="." else False for s in input()]
  map_matrix.append(line)
  calc_matrix.append([0]*W)

map_matrix_h=[]
for h in range(H):
  line=[i for i, x in enumerate(map_matrix[h]) if not x]
  map_matrix_h.append([-1]+line+[W])

#print(map_matrix_h)
score_matrix_h=[]
for i in range(H):
  h2list = map_matrix_h[i]  
  score = [W]*W
  for j in range(len(h2list)-1):
    hl=h2list[j]
    hr=h2list[j+1]    
    #print("{},{}".format(hl,hr))
    if hl==-1 and hr==W:
      score=[W]*W
    elif hl==-1:
      score[0:hr]=[hr]*hr
      score[hr]=0
    elif hr==W:
      score[hl]=0
      score[hl+1:]=[W-hl-1]*(W-hl-1)
    else:
      score[hl]=0
      score[hl+1:hr]=[hr-hl-1]*(hr-hl-1)
      score[hr]=0
  #print(score)
  score_matrix_h.append(score)

map_matrix_w=[]
map_matrix_tr=list(map(list, zip(*map_matrix)))
#print(map_matrix_tr)

for w in range(W):
  line=[i for i, x in enumerate(map_matrix_tr[w]) if not x]
  #map_matrix_w.append(line)
  map_matrix_w.append([-1]+line+[H])

#print(map_matrix_w)
score_matrix_w=[]
for i in range(W):
  w2list = map_matrix_w[i]  
  score = [H]*H
  for j in range(len(w2list)-1):
    wl=w2list[j]
    wr=w2list[j+1]    
    #print("{},{}".format(hl,hr))
    if wl==-1 and wr==H:
      score=[H]*H
    elif wl==-1:
      score[0:wr]=[wr]*wr
      score[wr]=0
    elif wr==H:
      score[wl]=0
      score[wl+1:]=[H-wl-1]*(H-wl-1)
    else:
      score[wl]=0
      score[wl+1:wr]=[wr-wl-1]*(wr-wl-1)
      score[wr]=0
  #print(score)
  score_matrix_w.append(score)

#print(score_matrix_w)

max_right = -1
for i in range(H):
  for j in range(W):
    right = score_matrix_h[i][j]+score_matrix_w[j][i]-1
    if right > max_right:
      max_right = right
      
print(max_right)

Fixed submission:
H,W=map(int,input().split())
map_matrix=[]
calc_matrix=[]
for i in range(H):
  line=[True if s=="." else False for s in input()]
  map_matrix.append(line)
  calc_matrix.append([0]*W)

map_matrix_h=[]
for h in range(H):
  line=[i for i, x in enumerate(map_matrix[h]) if not x]
  map_matrix_h.append([-1]+line+[W])

#print(map_matrix_h)
score_matrix_h=[]
for i in range(H):
  h2list = map_matrix_h[i]  
  score = [W]*W
  for j in range(len(h2list)-1):
    hl=h2list[j]
    hr=h2list[j+1]    
    #print("{},{}".format(hl,hr))
    if hl==-1 and hr==W:
      score=[W]*W
    elif hl==-1:
      score[0:hr]=[hr]*hr
      score[hr]=0
    elif hr==W:
      score[hl]=0
      score[hl+1:]=[W-hl-1]*(W-hl-1)
    else:
      score[hl]=0
      score[hl+1:hr]=[hr-hl-1]*(hr-hl-1)
      score[hr]=0
  #print(score)
  score_matrix_h.append(score)

map_matrix_w=[]
map_matrix_tr=list(map(list, zip(*map_matrix)))
#print(map_matrix_tr)

for w in range(W):
  line=[i for i, x in enumerate(map_matrix_tr[w]) if not x]
  #map_matrix_w.append(line)
  map_matrix_w.append([-1]+line+[H])

#print(map_matrix_w)
score_matrix_w=[]
for i in range(W):
  w2list = map_matrix_w[i]  
  score = [H]*H
  for j in range(len(w2list)-1):
    wl=w2list[j]
    wr=w2list[j+1]    
    #print("{},{}".format(hl,hr))
    if wl==-1 and wr==H:
      score=[H]*H
    elif wl==-1:
      score[0:wr]=[wr]*wr
      score[wr]=0
    elif wr==H:
      score[wl]=0
      score[wl+1:]=[H-wl-1]*(H-wl-1)
    else:
      score[wl]=0
      score[wl+1:wr]=[wr-wl-1]*(wr-wl-1)
      score[wr]=0
  #print(score)
  score_matrix_w.append(score)

#print(score_matrix_w)

max_right = -1
for i in range(H):
  for j in range(W):
    right = score_matrix_h[i][j]+score_matrix_w[j][i]-1
    if right > max_right:
      max_right = right
      
print(max_right)