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

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

count_matw = [[0 for w in range(W)]for h in range(H)]

count_math = [[0 for w in range(W)]for h in range(H)]



for h in range(H):

    count = 0

    for w in range(W):

        if '#' == S[h][w]:

            count = 0

        else:

            count += 1

        count_matw[h][w] = count

    for w in range(W-1, 0, -1):

        if count_matw[h][w-1] == 0:

            continue

        count_matw[h][w-1] = max(count_matw[h][w], count_matw[h][w-1])



for w in range(W):

    count = 0

    for h in range(H):

        if '#' == S[h][w]:

            count = 0

        else:

            count += 1

        count_math[h][w] = count

    for h in range(H-1, 0, -1):

        if count_math[h-1][w] == 0:

            continue

        count_math[h-1][w] = max(count_math[h][w], count_math[h-1][w])

ans = 1

# for h in range(H):

#     for w in range(W):

#         ans = max(ans, count_math[h][w] + count_matw[h][w])

ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])

# print(count_math)

# print(count_matw)

print((ans-1))

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

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

count_matw = [[0 for w in range(W)]for h in range(H)]

count_math = [[0 for w in range(W)]for h in range(H)]



for h in range(H):

    count = 0

    for w in range(W):

        if '#' == S[h][w]:

            count = 0

        else:

            count += 1

        count_matw[h][w] = count

    for w in range(W-1, 0, -1):

        if count_matw[h][w-1] == 0:

            continue

        count_matw[h][w-1] = max(count_matw[h][w], count_matw[h][w-1])



for w in range(W):

    count = 0

    for h in range(H):

        if '#' == S[h][w]:

            count = 0

        else:

            count += 1

        count_math[h][w] = count

    for h in range(H-1, 0, -1):

        if count_math[h-1][w] == 0:

            continue

        count_math[h-1][w] = max(count_math[h][w], count_math[h-1][w])

ans = 1

for h in range(H):

    for w in range(W):

        ans = max(ans, count_math[h][w] + count_matw[h][w])

# ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])

# print(count_math)

# print(count_matw)

print((ans-1))

H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)] for h in range(H)]
count_math = [[0 for w in range(W)] for h in range(H)]
for h in range(H):
    count = 0
    for w in range(W):
        if "#" == S[h][w]:
            count = 0
        else:
            count += 1
        count_matw[h][w] = count
    for w in range(W - 1, 0, -1):
        if count_matw[h][w - 1] == 0:
            continue
        count_matw[h][w - 1] = max(count_matw[h][w], count_matw[h][w - 1])
for w in range(W):
    count = 0
    for h in range(H):
        if "#" == S[h][w]:
            count = 0
        else:
            count += 1
        count_math[h][w] = count
    for h in range(H - 1, 0, -1):
        if count_math[h - 1][w] == 0:
            continue
        count_math[h - 1][w] = max(count_math[h][w], count_math[h - 1][w])
ans = 1
# for h in range(H):
#     for w in range(W):
#         ans = max(ans, count_math[h][w] + count_matw[h][w])
ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])
# print(count_math)
# print(count_matw)
print((ans - 1))

H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)] for h in range(H)]
count_math = [[0 for w in range(W)] for h in range(H)]
for h in range(H):
    count = 0
    for w in range(W):
        if "#" == S[h][w]:
            count = 0
        else:
            count += 1
        count_matw[h][w] = count
    for w in range(W - 1, 0, -1):
        if count_matw[h][w - 1] == 0:
            continue
        count_matw[h][w - 1] = max(count_matw[h][w], count_matw[h][w - 1])
for w in range(W):
    count = 0
    for h in range(H):
        if "#" == S[h][w]:
            count = 0
        else:
            count += 1
        count_math[h][w] = count
    for h in range(H - 1, 0, -1):
        if count_math[h - 1][w] == 0:
            continue
        count_math[h - 1][w] = max(count_math[h][w], count_math[h - 1][w])
ans = 1
for h in range(H):
    for w in range(W):
        ans = max(ans, count_math[h][w] + count_matw[h][w])
# ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])
# print(count_math)
# print(count_matw)
print((ans - 1))

-# for h in range(H): -#     for w in range(W): -#         ans = max(ans, count_math[h][w] + count_matw[h][w]) -ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)]) +for h in range(H): +    for w in range(W): +        ans = max(ans, count_math[h][w] + count_matw[h][w]) +# ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])