import numpy as np

import sys

buf = sys.stdin.buffer



H, W = list(map(int, buf.readline().split()))

grid = np.zeros((H + 2, W + 2), np.int32)

grid[1:-1, 1:-1] = np.where(np.array(list(map(list, buf.read().decode('utf-8').split()))).reshape(H, W) == '.', 1, 0)

grid_v = grid.T



right = np.maximum.accumulate(np.where(grid < 1, np.arange(W + 2), 0), axis=1)

left = np.fliplr(np.minimum.accumulate(np.fliplr(np.where(grid < 1, np.arange(W + 2), 10 ** 10)).copy(), axis=1))

down = np.maximum.accumulate(np.where(grid_v < 1, np.arange(H + 2), 0), axis=1).T

up = np.fliplr(np.minimum.accumulate(np.fliplr(np.where(grid_v < 1, np.arange(H + 2), 10 ** 10)).copy(), axis=1)).T



print((np.max((left - right) + (up - down)) - 3))
import numpy as np

import sys

line = sys.stdin.readline



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

grid = np.zeros((H + 2, W + 2), np.int32)

grid[1:-1, 1:-1] = (np.array([list(line().rstrip()) for _ in range(H)]).reshape(H, W) == '.') * 1

grid_v = grid.T



right = np.maximum.accumulate(np.where(grid < 1, np.arange(W + 2), 0), axis=1)

left = np.fliplr(np.minimum.accumulate(np.fliplr(np.where(grid < 1, np.arange(W + 2), 10 ** 10)).copy(), axis=1))

down = np.maximum.accumulate(np.where(grid_v < 1, np.arange(H + 2), 0), axis=1).T

up = np.fliplr(np.minimum.accumulate(np.fliplr(np.where(grid_v < 1, np.arange(H + 2), 10 ** 10)).copy(), axis=1)).T



print((np.max((left - right) + (up - down)) - 3))
import numpy as np
import sys

buf = sys.stdin.buffer
H, W = list(map(int, buf.readline().split()))
grid = np.zeros((H + 2, W + 2), np.int32)
grid[1:-1, 1:-1] = np.where(
    np.array(list(map(list, buf.read().decode("utf-8").split()))).reshape(H, W) == ".",
    1,
    0,
)
grid_v = grid.T
right = np.maximum.accumulate(np.where(grid < 1, np.arange(W + 2), 0), axis=1)
left = np.fliplr(
    np.minimum.accumulate(
        np.fliplr(np.where(grid < 1, np.arange(W + 2), 10**10)).copy(), axis=1
    )
)
down = np.maximum.accumulate(np.where(grid_v < 1, np.arange(H + 2), 0), axis=1).T
up = np.fliplr(
    np.minimum.accumulate(
        np.fliplr(np.where(grid_v < 1, np.arange(H + 2), 10**10)).copy(), axis=1
    )
).T
print((np.max((left - right) + (up - down)) - 3))

import numpy as np
import sys

line = sys.stdin.readline
H, W = list(map(int, line().split()))
grid = np.zeros((H + 2, W + 2), np.int32)
grid[1:-1, 1:-1] = (
    np.array([list(line().rstrip()) for _ in range(H)]).reshape(H, W) == "."
) * 1
grid_v = grid.T
right = np.maximum.accumulate(np.where(grid < 1, np.arange(W + 2), 0), axis=1)
left = np.fliplr(
    np.minimum.accumulate(
        np.fliplr(np.where(grid < 1, np.arange(W + 2), 10**10)).copy(), axis=1
    )
)
down = np.maximum.accumulate(np.where(grid_v < 1, np.arange(H + 2), 0), axis=1).T
up = np.fliplr(
    np.minimum.accumulate(
        np.fliplr(np.where(grid_v < 1, np.arange(H + 2), 10**10)).copy(), axis=1
    )
).T
print((np.max((left - right) + (up - down)) - 3))

-buf = sys.stdin.buffer -H, W = list(map(int, buf.readline().split())) +line = sys.stdin.readline +H, W = list(map(int, line().split())) -grid[1:-1, 1:-1] = np.where( -    np.array(list(map(list, buf.read().decode("utf-8").split()))).reshape(H, W) == ".", -    1, -    0, -) +grid[1:-1, 1:-1] = ( +    np.array([list(line().rstrip()) for _ in range(H)]).reshape(H, W) == "." +) * 1