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

grid0 = [[0] * (W + 1) for _ in range(H + 1)]

# L -> R
for i in range(H):
    for j in range(W):
        if X[i][j] == ".":
            grid0[i + 1][j + 1] = grid0[i + 1][j] + 1
        
# L <- R
for i in range(H):
    for j in reversed(range(W)):
        if grid0[i + 1][j] > 0:
            grid0[i + 1][j] = max(grid0[i + 1][j], grid0[i + 1][j + 1])

grid1 = [[0] * (W + 1) for _ in range(H + 1)]
for i in range(H):
    for j in range(W):
        if X[i][j] == ".":
            grid1[i + 1][j + 1] = grid1[i][j + 1] + 1

for i in reversed(range(H)):
    for j in range(W):
        if grid1[i][j + 1] > 0:
            grid1[i][j + 1] = max(grid1[i][j + 1], grid1[i + 1][j + 1])

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

grid0 = [[0] * (W + 1) for _ in range(H + 1)]

# L -> R
for i in range(H):
    for j in range(W):
        if X[i][j] == ".":
            grid0[i + 1][j + 1] = grid0[i + 1][j] + 1
        
# L <- R
for i in range(H):
    for j in reversed(range(W)):
        if grid0[i + 1][j] > 0:
            grid0[i + 1][j] = max(grid0[i + 1][j], grid0[i + 1][j + 1])

grid1 = [[0] * (W + 1) for _ in range(H + 1)]
for i in range(H):
    for j in range(W):
        if X[i][j] == ".":
            grid1[i + 1][j + 1] = grid1[i][j + 1] + 1

for i in reversed(range(H)):
    for j in range(W):
        if grid1[i][j + 1] > 0:
            grid1[i][j + 1] = max(grid1[i][j + 1], grid1[i + 1][j + 1])

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, grid0[i + 1][j + 1] + grid1[i + 1][j + 1] - 1)
print(ans)
