h, w = list(map(int, input().split()))

s = [eval(input()) for _ in range(h)]

sy = [0] * w

ret = 0

for y in range(h):

    seqx = 0

    seqy = 0

    for x in range(w):

        if s[y][x] == '.':

            if sy[x] == 0:

                yy = y

                while yy < h and s[yy][x] != '#':

                    yy += 1

                sy[x] = yy - y

            seqx += 1

            seqy = max(seqy, sy[x])

            ret = max(ret, seqx + seqy - 1)

        else:

            seqx = 0

            seqy = 0

            sy[x] = 0

print(ret)

import numpy as np

import sys

 

def main():

    sin = sys.stdin.buffer

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

    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")

    grid = grid.reshape((H, W + 1))[:, :-1]

 

    L = np.empty((H, W), dtype="i4")

    R = np.empty((H, W), dtype="i4")

    T = np.empty((H, W), dtype="i4")

    B = np.empty((H, W), dtype="i4")

 

    T[0] = grid[0]

    for i in range(1, H):

        T[i] = (T[i - 1] + 1) * grid[i]

 

    B[-1] = grid[-1]

    for i in range(H - 2, -1, -1):

        B[i] = (B[i + 1] + 1) * grid[i]

 

    L[:, 0] = grid[:, 0]

    for i in range(1, W):

        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]

 

    R[:, -1] = grid[:, -1]

    for i in range(W - 2, -1, -1):

        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]

 

    ans = (T + B + L + R - 3).max()

    print(ans)

 

main()
h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
sy = [0] * w
ret = 0
for y in range(h):
    seqx = 0
    seqy = 0
    for x in range(w):
        if s[y][x] == ".":
            if sy[x] == 0:
                yy = y
                while yy < h and s[yy][x] != "#":
                    yy += 1
                sy[x] = yy - y
            seqx += 1
            seqy = max(seqy, sy[x])
            ret = max(ret, seqx + seqy - 1)
        else:
            seqx = 0
            seqy = 0
            sy[x] = 0
print(ret)

import numpy as np
import sys


def main():
    sin = sys.stdin.buffer
    H, W = list(map(int, sin.readline().split()))
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
    ans = (T + B + L + R - 3).max()
    print(ans)


main()

-h, w = list(map(int, input().split())) -s = [eval(input()) for _ in range(h)] -sy = [0] * w -ret = 0 -for y in range(h): -    seqx = 0 -    seqy = 0 -    for x in range(w): -        if s[y][x] == ".": -            if sy[x] == 0: -                yy = y -                while yy < h and s[yy][x] != "#": -                    yy += 1 -                sy[x] = yy - y -            seqx += 1 -            seqy = max(seqy, sy[x]) -            ret = max(ret, seqx + seqy - 1) -        else: -            seqx = 0 -            seqy = 0 -            sy[x] = 0 -print(ret) +import numpy as np +import sys + + +def main(): +    sin = sys.stdin.buffer +    H, W = list(map(int, sin.readline().split())) +    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".") +    grid = grid.reshape((H, W + 1))[:, :-1] +    L = np.empty((H, W), dtype="i4") +    R = np.empty((H, W), dtype="i4") +    T = np.empty((H, W), dtype="i4") +    B = np.empty((H, W), dtype="i4") +    T[0] = grid[0] +    for i in range(1, H): +        T[i] = (T[i - 1] + 1) * grid[i] +    B[-1] = grid[-1] +    for i in range(H - 2, -1, -1): +        B[i] = (B[i + 1] + 1) * grid[i] +    L[:, 0] = grid[:, 0] +    for i in range(1, W): +        L[:, i] = (L[:, i - 1] + 1) * grid[:, i] +    R[:, -1] = grid[:, -1] +    for i in range(W - 2, -1, -1): +        R[:, i] = (R[:, i + 1] + 1) * grid[:, i] +    ans = (T + B + L + R - 3).max() +    print(ans) + + +main()