from collections import deque

H,W = list(map(int,input().split()))
D_h = {}
D_w = {}

for h in range(H):
    D_h[h]=deque([-1])
    
for w in range(W):
    D_w[w]=deque([-1])
    
for h in range(H):
    D = list(input())
    for w in range(W):
        if D[w] =='#':
            D_h[h].append(w)
            D_w[w].append(h)
            
    D_h[h].append(W)
    
for w in range(W):
    D_w[w].append(H)
    
Lamp_h = [ [0] * W  for h in range(H) ]

for d_h in D_h.keys():
    obst = D_h[d_h]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_h[d_h][o] = o_ed-1 - o_st
    
Lamp_w =  [ [0] * H  for w in range(W) ]
for d_w in D_w.keys():
    obst = D_w[d_w]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_w[d_w][o] = o_ed-1 - o_st
    
ans = 0
for h in range(H):
    for w in range(W):
        ans_ = Lamp_h[h][w] + Lamp_w[w][h] 
        if ans < ans_:
            ans =ans_
        
print(ans-1) from collections import deque H,W = list(map(int,input().split())) H list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split W D_h = {} D_h {} D_w = {} D_w {} for h in range(H):
    D_h[h]=deque([-1])
     h range(H) range H D_h[h]=deque([-1]) D_h[h] D_h h deque([-1]) deque [-1] -1 for w in range(W):
    D_w[w]=deque([-1])
     w range(W) range W D_w[w]=deque([-1]) D_w[w] D_w w deque([-1]) deque [-1] -1 for h in range(H):
    D = list(input())
    for w in range(W):
        if D[w] =='#':
            D_h[h].append(w)
            D_w[w].append(h)
            
    D_h[h].append(W)
     h range(H) range H D = list(input()) D list(input()) list input() input for w in range(W):
        if D[w] =='#':
            D_h[h].append(w)
            D_w[w].append(h)
            
     w range(W) range W if D[w] =='#':
            D_h[h].append(w)
            D_w[w].append(h)
            
     D[w] =='#' D[w] D w '#' D_h[h].append(w) [h].append [h] D_h h append w D_w[w].append(h) [w].append [w] D_w w append h D_h[h].append(W) [h].append [h] D_h h append W for w in range(W):
    D_w[w].append(H)
     w range(W) range W D_w[w].append(H) [w].append [w] D_w w append H [0] * W  for h in range(H) for h in range(H) h range(H) range H for h in range(H) [0] * W [0] 0 W Lamp_h = [ [0] * W  for h in range(H) ] Lamp_h [ [0] * W  for h in range(H) ] for d_h in D_h.keys():
    obst = D_h[d_h]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_h[d_h][o] = o_ed-1 - o_st
     d_h D_h.keys() D_h.keys D_h keys obst = D_h[d_h] obst D_h[d_h] D_h d_h for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_h[d_h][o] = o_ed-1 - o_st
     o_ed range(1,len(obst)) range 1 len(obst) len obst o_st = o_ed-1 o_st o_ed-1 o_ed 1 o_st = obst[o_st] o_st obst[o_st] obst o_st o_ed = obst[o_ed] o_ed obst[o_ed] obst o_ed for o in range(o_st+1,o_ed):
            Lamp_h[d_h][o] = o_ed-1 - o_st
     o range(o_st+1,o_ed) range o_st+1 o_st 1 o_ed Lamp_h[d_h][o] = o_ed-1 - o_st Lamp_h[d_h][o] [d_h] Lamp_h d_h o o_ed-1 - o_st o_ed-1 o_ed 1 o_st [0] * H  for w in range(W) for w in range(W) w range(W) range W for w in range(W) [0] * H [0] 0 H Lamp_w =  [ [0] * H  for w in range(W) ] Lamp_w [ [0] * H  for w in range(W) ] for d_w in D_w.keys():
    obst = D_w[d_w]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_w[d_w][o] = o_ed-1 - o_st
     d_w D_w.keys() D_w.keys D_w keys obst = D_w[d_w] obst D_w[d_w] D_w d_w for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_w[d_w][o] = o_ed-1 - o_st
     o_ed range(1,len(obst)) range 1 len(obst) len obst o_st = o_ed-1 o_st o_ed-1 o_ed 1 o_st = obst[o_st] o_st obst[o_st] obst o_st o_ed = obst[o_ed] o_ed obst[o_ed] obst o_ed for o in range(o_st+1,o_ed):
            Lamp_w[d_w][o] = o_ed-1 - o_st
     o range(o_st+1,o_ed) range o_st+1 o_st 1 o_ed Lamp_w[d_w][o] = o_ed-1 - o_st Lamp_w[d_w][o] [d_w] Lamp_w d_w o o_ed-1 - o_st o_ed-1 o_ed 1 o_st ans = 0 ans 0 for h in range(H):
    for w in range(W):
        ans_ = Lamp_h[h][w] + Lamp_w[w][h] 
        if ans < ans_:
            ans =ans_
         h range(H) range H for w in range(W):
        ans_ = Lamp_h[h][w] + Lamp_w[w][h] 
        if ans < ans_:
            ans =ans_
         w range(W) range W ans_ = Lamp_h[h][w] + Lamp_w[w][h] ans_ Lamp_h[h][w] + Lamp_w[w][h] Lamp_h[h][w] [h] Lamp_h h w Lamp_w[w][h] [w] Lamp_w w h if ans < ans_:
            ans =ans_
         ans < ans_ ans ans_ ans =ans_ ans ans_ print(ans-1) print ans-1 ans 1 D = list(input()) list(input()) D Lamp_w =  [ [0] * H  for w in range(W) ] [ [0] * H  for w in range(W) ] Lamp_w o_st = obst[o_st] obst[o_st] o_st W = list(map(int,input().split())) list(map(int,input().split())) W H,W = list(map(int,input().split())) list(map(int,input().split())) H o_st = obst[o_st] obst[o_st] o_st Lamp_h = [ [0] * W  for h in range(H) ] [ [0] * W  for h in range(H) ] Lamp_h o_st = o_ed-1 o_ed-1 o_st obst = D_w[d_w] D_w[d_w] obst obst = D_h[d_h] D_h[d_h] obst D_w = {} {} D_w D_h = {} {} D_h o_st = o_ed-1 o_ed-1 o_st ans = 0 0 ans ans =ans_ ans_ ans o_ed = obst[o_ed] obst[o_ed] o_ed o_ed = obst[o_ed] obst[o_ed] o_ed ans_ = Lamp_h[h][w] + Lamp_w[w][h] Lamp_h[h][w] + Lamp_w[w][h] ans_
from collections import deque

H,W = list(map(int,input().split()))
D_h = {}
D_w = {}

for h in range(H):
    D_h[h]=deque([-1])
    
for w in range(W):
    D_w[w]=deque([-1])
    
for h in range(H):
    D = list(input())
    for w in range(W):
        if D[w] =='#':
            D_h[h].append(w)
            D_w[w].append(h)
            
    D_h[h].append(W)
    
for w in range(W):
    D_w[w].append(H)
    
Lamp_h = [ [0] * W  for h in range(H) ]

for d_h in D_h.keys():
    obst = D_h[d_h]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_h[d_h][o] = o_ed-1 - o_st
    
Lamp_w =  [ [0] * H  for w in range(W) ]
for d_w in D_w.keys():
    obst = D_w[d_w]
    for o_ed in range(1,len(obst)):
        o_st = o_ed-1
        
        o_st = obst[o_st]
        o_ed = obst[o_ed]
        
        for o in range(o_st+1,o_ed):
            Lamp_w[d_w][o] = o_ed-1 - o_st
    
ans = 0
for h in range(H):
    for w in range(W):
        ans_ = Lamp_h[h][w] + Lamp_w[w][h] 
        if ans < ans_:
            ans =ans_
        
print(ans-1)