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

L = [[0]*W for _ in range(H)]
U = [[0]*W for _ in range(H)]
for h in range(H):
    for w in range(W):
        if S[h][w] == "#":
            L[h][w] = 0
        elif w == 0:
            L[h][w] = 1
        else:
            L[h][w] = L[h][w-1] + 1
        
        if S[h][w] == "#":
            U[h][w] = 0
        elif h == 0:
            U[h][w] = 1
        else:
            U[h][w] = U[h-1][w] + 1

R = [[0]*W for _ in range(H)]
D = [[0]*W for _ in range(H)]
for h in range(H-1, -1, -1):
    for w in range(W-1, -1, -1):
        if S[h][w] == "#":
            R[h][w] = 0
        elif w == W-1:
            R[h][w] = 1
        else:
            R[h][w] = R[h][w+1] + 1

        if S[h][w] == "#":
            D[h][w] = 0
        elif h == H-1:
            D[h][w] = 1
        else:
            D[h][w] = D[h+1][w] + 1

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3)

print(ans) H, W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W S = [] S [] for _ in range(H):
    S.append(input()) _ range(H) range H S.append(input()) S.append S append input() input [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W L = [[0]*W for _ in range(H)] L [[0]*W for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W U = [[0]*W for _ in range(H)] U [[0]*W for _ in range(H)] for h in range(H):
    for w in range(W):
        if S[h][w] == "#":
            L[h][w] = 0
        elif w == 0:
            L[h][w] = 1
        else:
            L[h][w] = L[h][w-1] + 1
        
        if S[h][w] == "#":
            U[h][w] = 0
        elif h == 0:
            U[h][w] = 1
        else:
            U[h][w] = U[h-1][w] + 1 h range(H) range H for w in range(W):
        if S[h][w] == "#":
            L[h][w] = 0
        elif w == 0:
            L[h][w] = 1
        else:
            L[h][w] = L[h][w-1] + 1
        
        if S[h][w] == "#":
            U[h][w] = 0
        elif h == 0:
            U[h][w] = 1
        else:
            U[h][w] = U[h-1][w] + 1 w range(W) range W if S[h][w] == "#":
            L[h][w] = 0
        elif w == 0:
            L[h][w] = 1
        else:
            L[h][w] = L[h][w-1] + 1
        
         S[h][w] == "#" S[h][w] [h] S h w "#" L[h][w] = 0 L[h][w] [h] L h w 0 elif w == 0:
            L[h][w] = 1
         w == 0 w 0 L[h][w] = 1 L[h][w] [h] L h w 1 L[h][w] = L[h][w-1] + 1 L[h][w] [h] L h w L[h][w-1] + 1 L[h][w-1] [h] L h w-1 w 1 1 if S[h][w] == "#":
            U[h][w] = 0
        elif h == 0:
            U[h][w] = 1
        else:
            U[h][w] = U[h-1][w] + 1 S[h][w] == "#" S[h][w] [h] S h w "#" U[h][w] = 0 U[h][w] [h] U h w 0 elif h == 0:
            U[h][w] = 1
         h == 0 h 0 U[h][w] = 1 U[h][w] [h] U h w 1 U[h][w] = U[h-1][w] + 1 U[h][w] [h] U h w U[h-1][w] + 1 U[h-1][w] [h-1] U h-1 h 1 w 1 [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W R = [[0]*W for _ in range(H)] R [[0]*W for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W D = [[0]*W for _ in range(H)] D [[0]*W for _ in range(H)] for h in range(H-1, -1, -1):
    for w in range(W-1, -1, -1):
        if S[h][w] == "#":
            R[h][w] = 0
        elif w == W-1:
            R[h][w] = 1
        else:
            R[h][w] = R[h][w+1] + 1

        if S[h][w] == "#":
            D[h][w] = 0
        elif h == H-1:
            D[h][w] = 1
        else:
            D[h][w] = D[h+1][w] + 1 h range(H-1, -1, -1) range H-1 H 1 -1 -1 for w in range(W-1, -1, -1):
        if S[h][w] == "#":
            R[h][w] = 0
        elif w == W-1:
            R[h][w] = 1
        else:
            R[h][w] = R[h][w+1] + 1

        if S[h][w] == "#":
            D[h][w] = 0
        elif h == H-1:
            D[h][w] = 1
        else:
            D[h][w] = D[h+1][w] + 1 w range(W-1, -1, -1) range W-1 W 1 -1 -1 if S[h][w] == "#":
            R[h][w] = 0
        elif w == W-1:
            R[h][w] = 1
        else:
            R[h][w] = R[h][w+1] + 1

         S[h][w] == "#" S[h][w] [h] S h w "#" R[h][w] = 0 R[h][w] [h] R h w 0 elif w == W-1:
            R[h][w] = 1
         w == W-1 w W-1 W 1 R[h][w] = 1 R[h][w] [h] R h w 1 R[h][w] = R[h][w+1] + 1 R[h][w] [h] R h w R[h][w+1] + 1 R[h][w+1] [h] R h w+1 w 1 1 if S[h][w] == "#":
            D[h][w] = 0
        elif h == H-1:
            D[h][w] = 1
        else:
            D[h][w] = D[h+1][w] + 1 S[h][w] == "#" S[h][w] [h] S h w "#" D[h][w] = 0 D[h][w] [h] D h w 0 elif h == H-1:
            D[h][w] = 1
         h == H-1 h H-1 H 1 D[h][w] = 1 D[h][w] [h] D h w 1 D[h][w] = D[h+1][w] + 1 D[h][w] [h] D h w D[h+1][w] + 1 D[h+1][w] [h+1] D h+1 h 1 w 1 ans = 0 ans 0 for h in range(H):
    for w in range(W):
        ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) h range(H) range H for w in range(W):
        ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) w range(W) range W ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) ans max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) max ans L[h][w]+R[h][w]+U[h][w]+D[h][w]-3 L[h][w]+R[h][w]+U[h][w]+D[h][w] L[h][w]+R[h][w]+U[h][w] L[h][w]+R[h][w] L[h][w] [h] L h w R[h][w] [h] R h w U[h][w] [h] U h w D[h][w] [h] D h w 3 print(ans) print ans S = [] [] S D = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] D ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3) ans W = map(int,input().split()) map(int,input().split()) W U = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] U H, W = map(int,input().split()) map(int,input().split()) H R = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] R ans = 0 0 ans L = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] L
H, W = map(int,input().split())
S = []
for _ in range(H):
    S.append(input())

L = [[0]*W for _ in range(H)]
U = [[0]*W for _ in range(H)]
for h in range(H):
    for w in range(W):
        if S[h][w] == "#":
            L[h][w] = 0
        elif w == 0:
            L[h][w] = 1
        else:
            L[h][w] = L[h][w-1] + 1
        
        if S[h][w] == "#":
            U[h][w] = 0
        elif h == 0:
            U[h][w] = 1
        else:
            U[h][w] = U[h-1][w] + 1

R = [[0]*W for _ in range(H)]
D = [[0]*W for _ in range(H)]
for h in range(H-1, -1, -1):
    for w in range(W-1, -1, -1):
        if S[h][w] == "#":
            R[h][w] = 0
        elif w == W-1:
            R[h][w] = 1
        else:
            R[h][w] = R[h][w+1] + 1

        if S[h][w] == "#":
            D[h][w] = 0
        elif h == H-1:
            D[h][w] = 1
        else:
            D[h][w] = D[h+1][w] + 1

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, L[h][w]+R[h][w]+U[h][w]+D[h][w]-3)

print(ans)