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

grid = [eval(input()) for _ in range(H)]



light = [0] * 4 * (W + 1) * (H + 1)



row = 4 * (W + 1)

col = 4



for h in range(H):

    for w in range(W):

        if grid[h][w] == '.':

            here = row * h + col * w

            light[row * (h + 1) + col * w + 1] = light[here + 1] + 1

            light[row * h + col * (w + 1) + 3] = light[here + 3] + 1



ans = 0

for h in range(H - 1, -1, -1):

    for w in range(W - 1, -1, -1):

        if grid[h][w] == '.':

            here = row * h + col * w

            light[row * (h - 1) + col * w + 0] = light[here + 0] + 1

            light[row * h + col * (w - 1) + 2] = light[here + 2] + 1

            ans = max(ans, sum(light[here: here + 4]) + 1)



print(ans)

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

grid = [eval(input()) for _ in range(H)]



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

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

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

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



for h in range(H):

    for w in range(W):

        if grid[h][w] == '.':

            L[h][w + 1] = L[h][w] + 1

            A[h + 1][w] = A[h][w] + 1



        hh = H - 1 - h

        ww = W - 1 - w

        if grid[hh][ww] == '.':

            B[hh - 1][ww] = B[hh][ww] + 1

            R[hh][ww - 1] = R[hh][ww] + 1



ans = 0

for h in range(H):

    for w in range(W):

        if grid[h][w] == '.':

            ans = max(ans, L[h][w] + R[h][w] + A[h][w] + B[h][w] + 1)

print(ans)

H, W = list(map(int, input().split()))
grid = [eval(input()) for _ in range(H)]
light = [0] * 4 * (W + 1) * (H + 1)
row = 4 * (W + 1)
col = 4
for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            here = row * h + col * w
            light[row * (h + 1) + col * w + 1] = light[here + 1] + 1
            light[row * h + col * (w + 1) + 3] = light[here + 3] + 1
ans = 0
for h in range(H - 1, -1, -1):
    for w in range(W - 1, -1, -1):
        if grid[h][w] == ".":
            here = row * h + col * w
            light[row * (h - 1) + col * w + 0] = light[here + 0] + 1
            light[row * h + col * (w - 1) + 2] = light[here + 2] + 1
            ans = max(ans, sum(light[here : here + 4]) + 1)
print(ans)

H, W = list(map(int, input().split()))
grid = [eval(input()) for _ in range(H)]
L = [[0] * (W + 1) for _ in range(H + 1)]
R = [[0] * (W + 1) for _ in range(H + 1)]
A = [[0] * (W + 1) for _ in range(H + 1)]
B = [[0] * (W + 1) for _ in range(H + 1)]
for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            L[h][w + 1] = L[h][w] + 1
            A[h + 1][w] = A[h][w] + 1
        hh = H - 1 - h
        ww = W - 1 - w
        if grid[hh][ww] == ".":
            B[hh - 1][ww] = B[hh][ww] + 1
            R[hh][ww - 1] = R[hh][ww] + 1
ans = 0
for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            ans = max(ans, L[h][w] + R[h][w] + A[h][w] + B[h][w] + 1)
print(ans)

-light = [0] * 4 * (W + 1) * (H + 1) -row = 4 * (W + 1) -col = 4 +L = [[0] * (W + 1) for _ in range(H + 1)] +R = [[0] * (W + 1) for _ in range(H + 1)] +A = [[0] * (W + 1) for _ in range(H + 1)] +B = [[0] * (W + 1) for _ in range(H + 1)] -            here = row * h + col * w -            light[row * (h + 1) + col * w + 1] = light[here + 1] + 1 -            light[row * h + col * (w + 1) + 3] = light[here + 3] + 1 +            L[h][w + 1] = L[h][w] + 1 +            A[h + 1][w] = A[h][w] + 1 +        hh = H - 1 - h +        ww = W - 1 - w +        if grid[hh][ww] == ".": +            B[hh - 1][ww] = B[hh][ww] + 1 +            R[hh][ww - 1] = R[hh][ww] + 1 -for h in range(H - 1, -1, -1): -    for w in range(W - 1, -1, -1): +for h in range(H): +    for w in range(W): -            here = row * h + col * w -            light[row * (h - 1) + col * w + 0] = light[here + 0] + 1 -            light[row * h + col * (w - 1) + 2] = light[here + 2] + 1 -            ans = max(ans, sum(light[here : here + 4]) + 1) +            ans = max(ans, L[h][w] + R[h][w] + A[h][w] + B[h][w] + 1)