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

w1=[[]for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j]=='#':
            w1[i].append(j)
    w1[i].append(W)

w2=[[0]*W for _ in range(H)]
for i in range(H):
    k=0
    L=-1
    R=w1[i][k]
    for j in range(W):
        if S[i][j]=='#':
            L=w1[i][k]
            k+=1
            R=w1[i][k]
            continue
        w2[i][j]=R-L-1

h1=[[]for _ in range(W)]
for j in range(W):
    for i in range(H):
        if S[i][j]=='#':
            h1[j].append(i)
    h1[j].append(H)

h2=[[0]*W for _ in range(H)]
for j in range(W):
    k=0
    L=-1
    R=h1[j][k]
    for i in range(H):
        if S[i][j]=='#':
            L=h1[j][k]
            k+=1
            R=h1[j][k]
            continue
        h2[i][j]=R-L-1

print(max(w2[i][j]+h2[i][j]-1 for i in range(H)for j in range(W))) H,W=map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W input()for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input() input S=[input()for _ in range(H)] S [input()for _ in range(H)] []for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] w1=[[]for _ in range(H)] w1 [[]for _ in range(H)] for i in range(H):
    for j in range(W):
        if S[i][j]=='#':
            w1[i].append(j)
    w1[i].append(W) i range(H) range H for j in range(W):
        if S[i][j]=='#':
            w1[i].append(j)
     j range(W) range W if S[i][j]=='#':
            w1[i].append(j)
     S[i][j]=='#' S[i][j] [i] S i j '#' w1[i].append(j) [i].append [i] w1 i append j w1[i].append(W) [i].append [i] w1 i append W [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W w2=[[0]*W for _ in range(H)] w2 [[0]*W for _ in range(H)] for i in range(H):
    k=0
    L=-1
    R=w1[i][k]
    for j in range(W):
        if S[i][j]=='#':
            L=w1[i][k]
            k+=1
            R=w1[i][k]
            continue
        w2[i][j]=R-L-1 i range(H) range H k=0 k 0 L=-1 L -1 R=w1[i][k] R w1[i][k] [i] w1 i k for j in range(W):
        if S[i][j]=='#':
            L=w1[i][k]
            k+=1
            R=w1[i][k]
            continue
        w2[i][j]=R-L-1 j range(W) range W if S[i][j]=='#':
            L=w1[i][k]
            k+=1
            R=w1[i][k]
            continue
         S[i][j]=='#' S[i][j] [i] S i j '#' L=w1[i][k] L w1[i][k] [i] w1 i k k+=1 k 1 R=w1[i][k] R w1[i][k] [i] w1 i k continue w2[i][j]=R-L-1 w2[i][j] [i] w2 i j R-L-1 R-L R L 1 []for _ in range(W) for _ in range(W) _ range(W) range W for _ in range(W) [] h1=[[]for _ in range(W)] h1 [[]for _ in range(W)] for j in range(W):
    for i in range(H):
        if S[i][j]=='#':
            h1[j].append(i)
    h1[j].append(H) j range(W) range W for i in range(H):
        if S[i][j]=='#':
            h1[j].append(i)
     i range(H) range H if S[i][j]=='#':
            h1[j].append(i)
     S[i][j]=='#' S[i][j] [i] S i j '#' h1[j].append(i) [j].append [j] h1 j append i h1[j].append(H) [j].append [j] h1 j append H [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W h2=[[0]*W for _ in range(H)] h2 [[0]*W for _ in range(H)] for j in range(W):
    k=0
    L=-1
    R=h1[j][k]
    for i in range(H):
        if S[i][j]=='#':
            L=h1[j][k]
            k+=1
            R=h1[j][k]
            continue
        h2[i][j]=R-L-1 j range(W) range W k=0 k 0 L=-1 L -1 R=h1[j][k] R h1[j][k] [j] h1 j k for i in range(H):
        if S[i][j]=='#':
            L=h1[j][k]
            k+=1
            R=h1[j][k]
            continue
        h2[i][j]=R-L-1 i range(H) range H if S[i][j]=='#':
            L=h1[j][k]
            k+=1
            R=h1[j][k]
            continue
         S[i][j]=='#' S[i][j] [i] S i j '#' L=h1[j][k] L h1[j][k] [j] h1 j k k+=1 k 1 R=h1[j][k] R h1[j][k] [j] h1 j k continue h2[i][j]=R-L-1 h2[i][j] [i] h2 i j R-L-1 R-L R L 1 print(max(w2[i][j]+h2[i][j]-1 for i in range(H)for j in range(W))) print max(w2[i][j]+h2[i][j]-1 for i in range(H)for j in range(W)) max w2[i][j]+h2[i][j]-1 w2[i][j]+h2[i][j] w2[i][j] [i] w2 i j h2[i][j] [i] h2 i j 1 W=map(int,input().split()) map(int,input().split()) W k+=1 1 k R=w1[i][k] w1[i][k] R H,W=map(int,input().split()) map(int,input().split()) H k=0 0 k k+=1 1 k L=-1 -1 L k=0 0 k w2=[[0]*W for _ in range(H)] [[0]*W for _ in range(H)] w2 L=w1[i][k] w1[i][k] L R=h1[j][k] h1[j][k] R h2=[[0]*W for _ in range(H)] [[0]*W for _ in range(H)] h2 R=w1[i][k] w1[i][k] R L=h1[j][k] h1[j][k] L h1=[[]for _ in range(W)] [[]for _ in range(W)] h1 L=-1 -1 L w1=[[]for _ in range(H)] [[]for _ in range(H)] w1 S=[input()for _ in range(H)] [input()for _ in range(H)] S R=h1[j][k] h1[j][k] R
H,W=map(int,input().split())
S=[input()for _ in range(H)]

w1=[[]for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j]=='#':
            w1[i].append(j)
    w1[i].append(W)

w2=[[0]*W for _ in range(H)]
for i in range(H):
    k=0
    L=-1
    R=w1[i][k]
    for j in range(W):
        if S[i][j]=='#':
            L=w1[i][k]
            k+=1
            R=w1[i][k]
            continue
        w2[i][j]=R-L-1

h1=[[]for _ in range(W)]
for j in range(W):
    for i in range(H):
        if S[i][j]=='#':
            h1[j].append(i)
    h1[j].append(H)

h2=[[0]*W for _ in range(H)]
for j in range(W):
    k=0
    L=-1
    R=h1[j][k]
    for i in range(H):
        if S[i][j]=='#':
            L=h1[j][k]
            k+=1
            R=h1[j][k]
            continue
        h2[i][j]=R-L-1

print(max(w2[i][j]+h2[i][j]-1 for i in range(H)for j in range(W)))