H,W = map(int,input().split())
S = []
for i in range(H):
    S.append(list(input()))
L = [[0 for _ in range(W)] for _ in range(H)]
R = [[0 for _ in range(W)] for _ in range(H)]
D = [[0 for _ in range(W)] for _ in range(H)]
U = [[0 for _ in range(W)] for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1
for i in range(H):
    for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1
for i in range(W):
    for j in range(H):
        if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1
for i in range(W):
    for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-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 i in range(H):
    S.append(list(input())) i range(H) range H S.append(list(input())) S.append S append list(input()) list input() input [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)] D = [[0 for _ in range(W)] for _ in range(H)] D [[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)] for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1 i range(H) range H for j in range(W):
        if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1 j range(W) range W if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1 S[i][j] == '#' S[i][j] [i] S i j '#' continue elif j == 0:
            L[i][j] += 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 for i in range(H):
    for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1 i range(H) range H for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1 j range(-1,-W-1,-1) range -1 -W-1 -W W 1 -1 if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1 S[i][j] == '#' S[i][j] [i] S i j '#' continue elif j == -1:
            R[i][j] += 1
         j == -1 j -1 R[i][j] += 1 R[i][j] [i] R i j 1 R[i][j] += R[i][j+1] + 1 R[i][j] [i] R i j R[i][j+1] + 1 R[i][j+1] [i] R i j+1 j 1 1 for i in range(W):
    for j in range(H):
        if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1 i range(W) range W for j in range(H):
        if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1 j range(H) range H if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1 S[j][i] == '#' S[j][i] [j] S j i '#' continue elif j == 0:
            U[j][i] += 1
         j == 0 j 0 U[j][i] += 1 U[j][i] [j] U j i 1 U[j][i] += U[j-1][i] + 1 U[j][i] [j] U j i U[j-1][i] + 1 U[j-1][i] [j-1] U j-1 j 1 i 1 for i in range(W):
    for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1 i range(W) range W for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1 j range(-1,-H-1,-1) range -1 -H-1 -H H 1 -1 if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1 S[j][i] == '#' S[j][i] [j] S j i '#' continue elif j == -1:
            D[j][i] += 1
         j == -1 j -1 D[j][i] += 1 D[j][i] [j] D j i 1 D[j][i] += D[j+1][i] + 1 D[j][i] [j] D j i D[j+1][i] + 1 D[j+1][i] [j+1] D j+1 j 1 i 1 ans = 0 ans 0 for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) i range(H) range H for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) j range(W) range W ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) ans max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) max ans U[i][j]+D[i][j]+L[i][j]+R[i][j]-3 U[i][j]+D[i][j]+L[i][j]+R[i][j] U[i][j]+D[i][j]+L[i][j] U[i][j]+D[i][j] U[i][j] [i] U i j D[i][j] [i] D i j L[i][j] [i] L i j R[i][j] [i] R i j 3 print(ans) print ans L = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] L U = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] U D = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] D ans = 0 0 ans S = [] [] S ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3) ans H,W = map(int,input().split()) map(int,input().split()) H W = map(int,input().split()) map(int,input().split()) W R = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] R
H,W = map(int,input().split())
S = []
for i in range(H):
    S.append(list(input()))
L = [[0 for _ in range(W)] for _ in range(H)]
R = [[0 for _ in range(W)] for _ in range(H)]
D = [[0 for _ in range(W)] for _ in range(H)]
U = [[0 for _ in range(W)] for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1
for i in range(H):
    for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1
for i in range(W):
    for j in range(H):
        if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1
for i in range(W):
    for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3)
print(ans)