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

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

#print(S)

dpyoko = [[1]*(W) for i in range(H)]

for j in range(W):

    for i in range(H):

        if S[i][j] == '#':

            dpyoko[i][j] = 0

        else:

            if j != 0:

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

dptate = [[1]*(W) for i in range(H)]

for i in range(H):

    for j in range(W):

        if S[i][j] == '#':

            dptate[i][j] = 0

        else:

            if i != 0:

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

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

    for i in range(H):

        if dpyoko[i][j] == 0:

            continue

        if j == W-1:

            continue

        dpyoko[i][j] = max(dpyoko[i][j],dpyoko[i][j+1])

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

    for j in range(W):

        if dptate[i][j] == 0:

            continue

        if i == H-1:

            continue

        dptate[i][j] = max(dptate[i][j],dptate[i+1][j])

dp = [[0]*(W) for i in range(H)]

res = 0

for i in range(H):

    for j in range(W):

        if S[i][j] == '#':

            continue

        dp[i][j] = dptate[i][j]+dpyoko[i][j]-1 

        if res < dp[i][j]:

            res = dp[i][j]

print(res)       

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

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

dpyoko = [[1]*(W) for i in range(H)]

for j in range(W):

    for i in range(H):

        if S[i][j] == '#':

            dpyoko[i][j] = 0

        else:

            if j != 0:

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

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

    for i in range(H):

        if dpyoko[i][j] == 0:

            continue

        if j == W-1:

            continue

        dpyoko[i][j] = max(dpyoko[i][j],dpyoko[i][j+1])

dptate = [[1]*(W) for i in range(H)]

for i in range(H):

    for j in range(W):

        if S[i][j] == '#':

            dptate[i][j] = 0

        else:

            if i != 0:

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

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

    for j in range(W):

        if dptate[i][j] == 0:

            continue

        if i == H-1:

            continue

        dptate[i][j] = max(dptate[i][j],dptate[i+1][j])

res = 0

for i in range(H):

    for j in range(W):

        res = max(res,dptate[i][j]+dpyoko[i][j]-1)

print(res)       

H, W = list(map(int, input().split()))
S = [list(eval(input())) for i in range(H)]
# print(S)
dpyoko = [[1] * (W) for i in range(H)]
for j in range(W):
    for i in range(H):
        if S[i][j] == "#":
            dpyoko[i][j] = 0
        else:
            if j != 0:
                dpyoko[i][j] += dpyoko[i][j - 1]
dptate = [[1] * (W) for i in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            dptate[i][j] = 0
        else:
            if i != 0:
                dptate[i][j] += dptate[i - 1][j]
for j in range(W - 1, -1, -1):
    for i in range(H):
        if dpyoko[i][j] == 0:
            continue
        if j == W - 1:
            continue
        dpyoko[i][j] = max(dpyoko[i][j], dpyoko[i][j + 1])
for i in range(H - 1, -1, -1):
    for j in range(W):
        if dptate[i][j] == 0:
            continue
        if i == H - 1:
            continue
        dptate[i][j] = max(dptate[i][j], dptate[i + 1][j])
dp = [[0] * (W) for i in range(H)]
res = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            continue
        dp[i][j] = dptate[i][j] + dpyoko[i][j] - 1
        if res < dp[i][j]:
            res = dp[i][j]
print(res)

H, W = list(map(int, input().split()))
S = [list(eval(input())) for i in range(H)]
dpyoko = [[1] * (W) for i in range(H)]
for j in range(W):
    for i in range(H):
        if S[i][j] == "#":
            dpyoko[i][j] = 0
        else:
            if j != 0:
                dpyoko[i][j] += dpyoko[i][j - 1]
for j in range(W - 1, -1, -1):
    for i in range(H):
        if dpyoko[i][j] == 0:
            continue
        if j == W - 1:
            continue
        dpyoko[i][j] = max(dpyoko[i][j], dpyoko[i][j + 1])
dptate = [[1] * (W) for i in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            dptate[i][j] = 0
        else:
            if i != 0:
                dptate[i][j] += dptate[i - 1][j]
for i in range(H - 1, -1, -1):
    for j in range(W):
        if dptate[i][j] == 0:
            continue
        if i == H - 1:
            continue
        dptate[i][j] = max(dptate[i][j], dptate[i + 1][j])
res = 0
for i in range(H):
    for j in range(W):
        res = max(res, dptate[i][j] + dpyoko[i][j] - 1)
print(res)

-# print(S) +for j in range(W - 1, -1, -1): +    for i in range(H): +        if dpyoko[i][j] == 0: +            continue +        if j == W - 1: +            continue +        dpyoko[i][j] = max(dpyoko[i][j], dpyoko[i][j + 1]) -for j in range(W - 1, -1, -1): -    for i in range(H): -        if dpyoko[i][j] == 0: -            continue -        if j == W - 1: -            continue -        dpyoko[i][j] = max(dpyoko[i][j], dpyoko[i][j + 1]) -dp = [[0] * (W) for i in range(H)] -        if S[i][j] == "#": -            continue -        dp[i][j] = dptate[i][j] + dpyoko[i][j] - 1 -        if res < dp[i][j]: -            res = dp[i][j] +        res = max(res, dptate[i][j] + dpyoko[i][j] - 1)