import numpy as np



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

S = np.array([list(eval(input())) for _ in range(H)]) == '.'

up = np.zeros((H, W), dtype=int)

down = np.zeros((H, W), dtype=int)

left = np.zeros((H, W), dtype=int)

right = np.zeros((H, W), dtype=int)

 

for i in range(H):

    up[i] = (up[i-1] + 1) * S[i]

    down[-i-1] = (down[-i] + 1) * S[-i-1]



for i in range(W):

    left[:, i] = (left[:, i-1] + 1) * S[:, i]

    right[:, -i-1] = (right[:, -i] + 1) * S[:, -i-1]



print((np.max(up+down+left+right)-3))
H, W = list(map(int, input().split()))

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

 

up =    [[0]*(W+2) for _ in range(H+2)]

down =  [[0]*(W+2) for _ in range(H+2)]

left =  [[0]*(W+2) for _ in range(H+2)]

right = [[0]*(W+2) for _ in range(H+2)]

 

for i in range(1, H+1):

    for j in range(1, W+1):

        if S[i-1][j-1] == '.':

            up[i][j] = up[i-1][j] + 1

            left[i][j] = left[i][j-1] + 1

        

        if S[-i][-j] == '.':

            down[-1-i][-1-j] = down[-i][-1-j] + 1

            right[-1-i][-1-j] = right[-1-i][-j] + 1

 

ans = 0

for i in range(1, H+1):

    for j in range(1, W+1):

        ans = max(ans, up[i][j]+down[i][j]+left[i][j]+right[i][j]-3)

print(ans)
import numpy as np

H, W = list(map(int, input().split()))
S = np.array([list(eval(input())) for _ in range(H)]) == "."
up = np.zeros((H, W), dtype=int)
down = np.zeros((H, W), dtype=int)
left = np.zeros((H, W), dtype=int)
right = np.zeros((H, W), dtype=int)
for i in range(H):
    up[i] = (up[i - 1] + 1) * S[i]
    down[-i - 1] = (down[-i] + 1) * S[-i - 1]
for i in range(W):
    left[:, i] = (left[:, i - 1] + 1) * S[:, i]
    right[:, -i - 1] = (right[:, -i] + 1) * S[:, -i - 1]
print((np.max(up + down + left + right) - 3))

H, W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
up = [[0] * (W + 2) for _ in range(H + 2)]
down = [[0] * (W + 2) for _ in range(H + 2)]
left = [[0] * (W + 2) for _ in range(H + 2)]
right = [[0] * (W + 2) for _ in range(H + 2)]
for i in range(1, H + 1):
    for j in range(1, W + 1):
        if S[i - 1][j - 1] == ".":
            up[i][j] = up[i - 1][j] + 1
            left[i][j] = left[i][j - 1] + 1
        if S[-i][-j] == ".":
            down[-1 - i][-1 - j] = down[-i][-1 - j] + 1
            right[-1 - i][-1 - j] = right[-1 - i][-j] + 1
ans = 0
for i in range(1, H + 1):
    for j in range(1, W + 1):
        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3)
print(ans)

-import numpy as np - -S = np.array([list(eval(input())) for _ in range(H)]) == "." -up = np.zeros((H, W), dtype=int) -down = np.zeros((H, W), dtype=int) -left = np.zeros((H, W), dtype=int) -right = np.zeros((H, W), dtype=int) -for i in range(H): -    up[i] = (up[i - 1] + 1) * S[i] -    down[-i - 1] = (down[-i] + 1) * S[-i - 1] -for i in range(W): -    left[:, i] = (left[:, i - 1] + 1) * S[:, i] -    right[:, -i - 1] = (right[:, -i] + 1) * S[:, -i - 1] -print((np.max(up + down + left + right) - 3)) +S = [eval(input()) for _ in range(H)] +up = [[0] * (W + 2) for _ in range(H + 2)] +down = [[0] * (W + 2) for _ in range(H + 2)] +left = [[0] * (W + 2) for _ in range(H + 2)] +right = [[0] * (W + 2) for _ in range(H + 2)] +for i in range(1, H + 1): +    for j in range(1, W + 1): +        if S[i - 1][j - 1] == ".": +            up[i][j] = up[i - 1][j] + 1 +            left[i][j] = left[i][j - 1] + 1 +        if S[-i][-j] == ".": +            down[-1 - i][-1 - j] = down[-i][-1 - j] + 1 +            right[-1 - i][-1 - j] = right[-1 - i][-j] + 1 +ans = 0 +for i in range(1, H + 1): +    for j in range(1, W + 1): +        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) +print(ans)