H, W = map(int, input().split())

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = input()

L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == "." and i - 1 < 0:
            D[i][j] = 1
        elif S[i][j] == "." and i - 1 >= 0:
            D[i][j] = D[i-1][j] + 1
        if S[i][j] == "." and j - 1 < 0:
            L[i][j] = 1
        elif S[i][j] == "." and j - 1 >= 0:
            L[i][j] = L[i][j-1] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        if S[i][j] == "." and i + 1 >= H:
            U[i][j] = 1
        elif S[i][j] == "." and i + 1 < H:
            U[i][j] = U[i+1][j] + 1
        if S[i][j] == "." and j + 1 >= W:
            R[i][j] = 1
        elif S[i][j] == "." and j + 1 < W:
            R[i][j] = R[i][j+1] + 1

ans = 0

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

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

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = input()

L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == "." and i - 1 < 0:
            D[i][j] = 1
        elif S[i][j] == "." and i - 1 >= 0:
            D[i][j] = D[i-1][j] + 1
        if S[i][j] == "." and j - 1 < 0:
            L[i][j] = 1
        elif S[i][j] == "." and j - 1 >= 0:
            L[i][j] = L[i][j-1] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        if S[i][j] == "." and i + 1 >= H:
            U[i][j] = 1
        elif S[i][j] == "." and i + 1 < H:
            U[i][j] = U[i+1][j] + 1
        if S[i][j] == "." and j + 1 >= W:
            R[i][j] = 1
        elif S[i][j] == "." and j + 1 < W:
            R[i][j] = R[i][j+1] + 1

ans = 0

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

print(ans)