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

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

for h in range(H):
    for w in range(W):
        if A[h][w] == '#':
            U[h][w] = 0
            L[h][w] = 0
        else:
            U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0)
            L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0)

        y = H - h - 1
        x = W - w - 1
        if A[y][x] == '#':
            D[y][x] = 0
            R[y][x] = 0
        else:
            D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0)
            R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0)

ans = 0
for h in range(H):
    for w in range(W):
        if A[h][w] == '.':
            ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3)
print(ans) 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 A = [input() for _ in range(H)] A [input() 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 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 D = [[0] * W for _ in range(H)] D [[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)] for h in range(H):
    for w in range(W):
        if A[h][w] == '#':
            U[h][w] = 0
            L[h][w] = 0
        else:
            U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0)
            L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0)

        y = H - h - 1
        x = W - w - 1
        if A[y][x] == '#':
            D[y][x] = 0
            R[y][x] = 0
        else:
            D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0)
            R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0) h range(H) range H for w in range(W):
        if A[h][w] == '#':
            U[h][w] = 0
            L[h][w] = 0
        else:
            U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0)
            L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0)

        y = H - h - 1
        x = W - w - 1
        if A[y][x] == '#':
            D[y][x] = 0
            R[y][x] = 0
        else:
            D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0)
            R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0) w range(W) range W if A[h][w] == '#':
            U[h][w] = 0
            L[h][w] = 0
        else:
            U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0)
            L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0)

         A[h][w] == '#' A[h][w] [h] A h w '#' U[h][w] = 0 U[h][w] [h] U h w 0 L[h][w] = 0 L[h][w] [h] L h w 0 U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0) U[h][w] [h] U h w 1 + (U[h - 1][w] if h > 0 else 0) 1 U[h - 1][w] if h > 0 else 0 h > 0 h 0 U[h - 1][w] [h - 1] U h - 1 h 1 w 0 L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0) L[h][w] [h] L h w 1 + (L[h][w - 1] if w > 0 else 0) 1 L[h][w - 1] if w > 0 else 0 w > 0 w 0 L[h][w - 1] [h] L h w - 1 w 1 0 y = H - h - 1 y H - h - 1 H - h H h 1 x = W - w - 1 x W - w - 1 W - w W w 1 if A[y][x] == '#':
            D[y][x] = 0
            R[y][x] = 0
        else:
            D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0)
            R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0) A[y][x] == '#' A[y][x] [y] A y x '#' D[y][x] = 0 D[y][x] [y] D y x 0 R[y][x] = 0 R[y][x] [y] R y x 0 D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0) D[y][x] [y] D y x 1 + (D[y + 1][x] if y < H - 1 else 0) 1 D[y + 1][x] if y < H - 1 else 0 y < H - 1 y H - 1 H 1 D[y + 1][x] [y + 1] D y + 1 y 1 x 0 R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0) R[y][x] [y] R y x 1 + (R[y][x + 1] if x < W - 1 else 0) 1 R[y][x + 1] if x < W - 1 else 0 x < W - 1 x W - 1 W 1 R[y][x + 1] [y] R y x + 1 x 1 0 ans = 0 ans 0 for h in range(H):
    for w in range(W):
        if A[h][w] == '.':
            ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) h range(H) range H for w in range(W):
        if A[h][w] == '.':
            ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) w range(W) range W if A[h][w] == '.':
            ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) A[h][w] == '.' A[h][w] [h] A h w '.' ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) ans max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) max ans U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3 U[h][w] + D[h][w] + L[h][w] + R[h][w] U[h][w] + D[h][w] + L[h][w] U[h][w] + D[h][w] U[h][w] [h] U h w D[h][w] [h] D h w L[h][w] [h] L h w R[h][w] [h] R h w 3 print(ans) print ans L = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] L W = map(int, input().split()) map(int, input().split()) W D = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] D ans = 0 0 ans A = [input() for _ in range(H)] [input() for _ in range(H)] A x = W - w - 1 W - w - 1 x R = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] R ans = max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) max(ans, U[h][w] + D[h][w] + L[h][w] + R[h][w] - 3) ans H, W = map(int, input().split()) map(int, input().split()) H y = H - h - 1 H - h - 1 y U = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] U
H, W = map(int, input().split())
A = [input() for _ in range(H)]

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

for h in range(H):
    for w in range(W):
        if A[h][w] == '#':
            U[h][w] = 0
            L[h][w] = 0
        else:
            U[h][w] = 1 + (U[h - 1][w] if h > 0 else 0)
            L[h][w] = 1 + (L[h][w - 1] if w > 0 else 0)

        y = H - h - 1
        x = W - w - 1
        if A[y][x] == '#':
            D[y][x] = 0
            R[y][x] = 0
        else:
            D[y][x] = 1 + (D[y + 1][x] if y < H - 1 else 0)
            R[y][x] = 1 + (R[y][x + 1] if x < W - 1 else 0)

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