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

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

# Left to right
for i in range(H + 1):
    for j in range(W):
        if grid0[i][j + 1] > 0:
            grid0[i][j + 1] += grid0[i][j]

# Right to left
for i in range(H + 1):
    for j in reversed(range(W)):
        if grid0[i][j] > 0:
            grid0[i][j] = max(grid0[i][j], grid0[i][j + 1])

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

# Top to down
for i in range(H):
    for j in range(W + 1):
        if grid1[i + 1][j] > 0:
            grid1[i + 1][j] += grid1[i][j]

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

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):
        grid0[i + 1][j + 1] = int(X[i][j] == ".")

# Left to right i range(H) range H for j in range(W):
        grid0[i + 1][j + 1] = int(X[i][j] == ".")

# Left to right j range(W) range W grid0[i + 1][j + 1] = int(X[i][j] == ".") grid0[i + 1][j + 1] [i + 1] grid0 i + 1 i 1 j + 1 j 1 int(X[i][j] == ".") int X[i][j] == "." X[i][j] [i] X i j "." for i in range(H + 1):
    for j in range(W):
        if grid0[i][j + 1] > 0:
            grid0[i][j + 1] += grid0[i][j]

# Right to left i range(H + 1) range H + 1 H 1 for j in range(W):
        if grid0[i][j + 1] > 0:
            grid0[i][j + 1] += grid0[i][j]

# Right to left j range(W) range W if grid0[i][j + 1] > 0:
            grid0[i][j + 1] += grid0[i][j]

# Right to left grid0[i][j + 1] > 0 grid0[i][j + 1] [i] grid0 i j + 1 j 1 0 grid0[i][j + 1] += grid0[i][j] grid0[i][j + 1] [i] grid0 i j + 1 j 1 grid0[i][j] [i] grid0 i j for i in range(H + 1):
    for j in reversed(range(W)):
        if grid0[i][j] > 0:
            grid0[i][j] = max(grid0[i][j], grid0[i][j + 1]) i range(H + 1) range H + 1 H 1 for j in reversed(range(W)):
        if grid0[i][j] > 0:
            grid0[i][j] = max(grid0[i][j], grid0[i][j + 1]) j reversed(range(W)) reversed range(W) range W if grid0[i][j] > 0:
            grid0[i][j] = max(grid0[i][j], grid0[i][j + 1]) grid0[i][j] > 0 grid0[i][j] [i] grid0 i j 0 grid0[i][j] = max(grid0[i][j], grid0[i][j + 1]) grid0[i][j] [i] grid0 i j max(grid0[i][j], grid0[i][j + 1]) max grid0[i][j] [i] grid0 i j grid0[i][j + 1] [i] grid0 i 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):
        grid1[i + 1][j + 1] = int(X[i][j] == ".")

# Top to down i range(H) range H for j in range(W):
        grid1[i + 1][j + 1] = int(X[i][j] == ".")

# Top to down j range(W) range W grid1[i + 1][j + 1] = int(X[i][j] == ".") grid1[i + 1][j + 1] [i + 1] grid1 i + 1 i 1 j + 1 j 1 int(X[i][j] == ".") int X[i][j] == "." X[i][j] [i] X i j "." for i in range(H):
    for j in range(W + 1):
        if grid1[i + 1][j] > 0:
            grid1[i + 1][j] += grid1[i][j]

# Down to top i range(H) range H for j in range(W + 1):
        if grid1[i + 1][j] > 0:
            grid1[i + 1][j] += grid1[i][j]

# Down to top j range(W + 1) range W + 1 W 1 if grid1[i + 1][j] > 0:
            grid1[i + 1][j] += grid1[i][j]

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

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

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

# Left to right
for i in range(H + 1):
    for j in range(W):
        if grid0[i][j + 1] > 0:
            grid0[i][j + 1] += grid0[i][j]

# Right to left
for i in range(H + 1):
    for j in reversed(range(W)):
        if grid0[i][j] > 0:
            grid0[i][j] = max(grid0[i][j], grid0[i][j + 1])

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

# Top to down
for i in range(H):
    for j in range(W + 1):
        if grid1[i + 1][j] > 0:
            grid1[i + 1][j] += grid1[i][j]

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

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)
