H, W = list(map(int, input().split()))
d = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j, x in enumerate(list(input())):        
        if x == "#":
            s = 0
        else:
            s = 1
        d[i][j] = s

# 自分より左のOKマスの数
L = [[0 for _ in range(W)] for _ in range(H)]
# 自分より右のOKマスの数
R = [[0 for _ in range(W)] for _ in range(H)]
# 自分より上のOKマスの数
U = [[0 for _ in range(W)] for _ in range(H)]
# 自分より下のOKマスの数
D = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j in range(W):
        # for L
        if d[i][j]:
            if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
        else:
            L[i][j] = 0
        
        # for R
        rj = W - j - 1
        if d[i][rj]:
            if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
        else:
            R[i][rj] = 0
        
        # for U        
        if d[i][j]:
            if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
        else:
            U[i][j] = 0
     
        # for D
        di = H - i - 1
        if d[di][j]:
            if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
        else:
            D[di][j] = 0

m = 0
for i in range(H):
    for j in range(W):
        m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
print(m) 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 [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] d = [[0 for _ in range(W)] for _ in range(H)] d [[0 for _ in range(W)] for _ in range(H)] for i in range(H):
    for j, x in enumerate(list(input())):        
        if x == "#":
            s = 0
        else:
            s = 1
        d[i][j] = s

# 自分より左のOKマスの数 i range(H) range H for j, x in enumerate(list(input())):        
        if x == "#":
            s = 0
        else:
            s = 1
        d[i][j] = s

# 自分より左のOKマスの数 j x enumerate(list(input())) enumerate list(input()) list input() input if x == "#":
            s = 0
        else:
            s = 1
         x == "#" x "#" s = 0 s 0 s = 1 s 1 d[i][j] = s d[i][j] [i] d i j s [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] L = [[0 for _ in range(W)] for _ in range(H)] L [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] R = [[0 for _ in range(W)] for _ in range(H)] R [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] U = [[0 for _ in range(W)] for _ in range(H)] U [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] D = [[0 for _ in range(W)] for _ in range(H)] D [[0 for _ in range(W)] for _ in range(H)] for i in range(H):
    for j in range(W):
        # for L
        if d[i][j]:
            if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
        else:
            L[i][j] = 0
        
        # for R
        rj = W - j - 1
        if d[i][rj]:
            if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
        else:
            R[i][rj] = 0
        
        # for U        
        if d[i][j]:
            if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
        else:
            U[i][j] = 0
     
        # for D
        di = H - i - 1
        if d[di][j]:
            if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
        else:
            D[di][j] = 0 i range(H) range H for j in range(W):
        # for L
        if d[i][j]:
            if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
        else:
            L[i][j] = 0
        
        # for R
        rj = W - j - 1
        if d[i][rj]:
            if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
        else:
            R[i][rj] = 0
        
        # for U        
        if d[i][j]:
            if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
        else:
            U[i][j] = 0
     
        # for D
        di = H - i - 1
        if d[di][j]:
            if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
        else:
            D[di][j] = 0 j range(W) range W if d[i][j]:
            if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
        else:
            L[i][j] = 0
        
        # for R
         d[i][j] [i] d i j if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
         j == 0 j 0 L[i][j] = 1 L[i][j] [i] L i j 1 L[i][j] = L[i][j-1] + 1 L[i][j] [i] L i j L[i][j-1] + 1 L[i][j-1] [i] L i j-1 j 1 1 L[i][j] = 0 L[i][j] [i] L i j 0 rj = W - j - 1 rj W - j - 1 W - j W j 1 if d[i][rj]:
            if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
        else:
            R[i][rj] = 0
        
        # for U        
         d[i][rj] [i] d i rj if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
         rj == W-1 rj W-1 W 1 R[i][rj] = 1 R[i][rj] [i] R i rj 1 R[i][rj] = R[i][rj+1] + 1 R[i][rj] [i] R i rj R[i][rj+1] + 1 R[i][rj+1] [i] R i rj+1 rj 1 1 R[i][rj] = 0 R[i][rj] [i] R i rj 0 if d[i][j]:
            if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
        else:
            U[i][j] = 0
     
        # for D
         d[i][j] [i] d i j if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
         i == 0 i 0 U[i][j] = 1 U[i][j] [i] U i j 1 U[i][j] = U[i-1][j] + 1 U[i][j] [i] U i j U[i-1][j] + 1 U[i-1][j] [i-1] U i-1 i 1 j 1 U[i][j] = 0 U[i][j] [i] U i j 0 di = H - i - 1 di H - i - 1 H - i H i 1 if d[di][j]:
            if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
        else:
            D[di][j] = 0 d[di][j] [di] d di j if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
         di == H-1 di H-1 H 1 D[di][j] = 1 D[di][j] [di] D di j 1 D[di][j] = D[di+1][j] + 1 D[di][j] [di] D di j D[di+1][j] + 1 D[di+1][j] [di+1] D di+1 di 1 j 1 D[di][j] = 0 D[di][j] [di] D di j 0 m = 0 m 0 for i in range(H):
    for j in range(W):
        m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) i range(H) range H for j in range(W):
        m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) j range(W) range W m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) m max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) max m L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 L[i][j] + R[i][j] + U[i][j] + D[i][j] L[i][j] + R[i][j] + U[i][j] L[i][j] + R[i][j] L[i][j] [i] L i j R[i][j] [i] R i j U[i][j] [i] U i j D[i][j] [i] D i j 3 print(m) print m H, W = list(map(int, input().split())) list(map(int, input().split())) H d = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] d s = 1 1 s R = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] R m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) m rj = W - j - 1 W - j - 1 rj D = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] D W = list(map(int, input().split())) list(map(int, input().split())) W di = H - i - 1 H - i - 1 di U = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] U m = 0 0 m s = 0 0 s L = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] L
H, W = list(map(int, input().split()))
d = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j, x in enumerate(list(input())):        
        if x == "#":
            s = 0
        else:
            s = 1
        d[i][j] = s

# 自分より左のOKマスの数
L = [[0 for _ in range(W)] for _ in range(H)]
# 自分より右のOKマスの数
R = [[0 for _ in range(W)] for _ in range(H)]
# 自分より上のOKマスの数
U = [[0 for _ in range(W)] for _ in range(H)]
# 自分より下のOKマスの数
D = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j in range(W):
        # for L
        if d[i][j]:
            if j == 0:
                L[i][j] = 1            
            else:
                L[i][j] = L[i][j-1] + 1
        else:
            L[i][j] = 0
        
        # for R
        rj = W - j - 1
        if d[i][rj]:
            if rj == W-1:
                R[i][rj] = 1            
            else:
                R[i][rj] = R[i][rj+1] + 1
        else:
            R[i][rj] = 0
        
        # for U        
        if d[i][j]:
            if i == 0:
                U[i][j] = 1            
            else:
                U[i][j] = U[i-1][j] + 1
        else:
            U[i][j] = 0
     
        # for D
        di = H - i - 1
        if d[di][j]:
            if di == H-1:
                D[di][j] = 1            
            else:
                D[di][j] = D[di+1][j] + 1
        else:
            D[di][j] = 0

m = 0
for i in range(H):
    for j in range(W):
        m = max(m, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
print(m)