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

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

L = [[0] * w for _ in range(h)]

R = [[0] * w for _ in range(h)]

U = [[0] * w for _ in range(h)]

D = [[0] * w for _ in range(h)]

for i in range(h):

    for j in range(w):

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

            if j == 0:

                L[i][j] = 1

            else:

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

    for j in reversed(list(range(w))):

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

            if j == w-1:

                R[i][j] = 1

            else:

                R[i][j] = R[i][j+1] + 1

for j in range(w):

    for i in range(h):

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

            if i == 0:

                U[i][j] = 1

            else:

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

    for i in reversed(list(range(h))):

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

            if i == h-1:

                D[i][j] = 1

            else:

                D[i][j] = D[i+1][j] + 1

ans = 0

for i in range(h):

    for j in range(w):

        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)

print(ans)

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

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

L = [[0] * w for _ in range(h)]

R = [[0] * w for _ in range(h)]

U = [[0] * w for _ in range(h)]

D = [[0] * w for _ in range(h)]

for i in range(h):

    for j in range(w):

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

            if j == 0:

                L[i][j] = 1

            else:

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

    for j in reversed(list(range(w))):

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

            if j == w-1:

                R[i][j] = 1

            else:

                R[i][j] = R[i][j+1] + 1

for j in range(w):

    for i in range(h):

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

            if i == 0:

                U[i][j] = 1

            else:

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

    for i in reversed(list(range(h))):

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

            if i == h-1:

                D[i][j] = 1

            else:

                D[i][j] = D[i+1][j] + 1

ans = 0

for i in range(h):

    for j in range(w):

        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)

print(ans)

h, w = list(map(int, input().split()))
S = [list(eval(input())) for _ in range(h)]
L = [[0] * w for _ in range(h)]
R = [[0] * w for _ in range(h)]
U = [[0] * w for _ in range(h)]
D = [[0] * w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j] == ".":
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1
    for j in reversed(list(range(w))):
        if S[i][j] == ".":
            if j == w - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1
for j in range(w):
    for i in range(h):
        if S[i][j] == ".":
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
    for i in reversed(list(range(h))):
        if S[i][j] == ".":
            if i == h - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
print(ans)

h, w = list(map(int, input().split()))
S = [eval(input()) for _ in range(h)]
L = [[0] * w for _ in range(h)]
R = [[0] * w for _ in range(h)]
U = [[0] * w for _ in range(h)]
D = [[0] * w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j] == ".":
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1
    for j in reversed(list(range(w))):
        if S[i][j] == ".":
            if j == w - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1
for j in range(w):
    for i in range(h):
        if S[i][j] == ".":
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
    for i in reversed(list(range(h))):
        if S[i][j] == ".":
            if i == h - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
print(ans)

-S = [list(eval(input())) for _ in range(h)] +S = [eval(input()) for _ in range(h)]