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

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



X = [[0] * W for _ in range(H)]

for i in range(H):

    start = 0

    cnt = 0

    for j in range(W):

        if s[i][j] == "." and j == W - 1:

            cnt += 1

            for k in range(start, W):

                if s[i][k] == ".":

                    X[i][k] = cnt

        elif s[i][j] == ".":

            cnt += 1

        elif s[i][j] == "#":

            for k in range(start, j):

                if s[i][k] == ".":

                    X[i][k] = cnt

            start = j

            cnt = 0



Y = [[0] * W for _ in range(H)]

for i in range(W):

    start = 0

    cnt = 0

    for j in range(H):

        if s[j][i] == "." and j == H - 1:

            cnt += 1

            for k in range(start, H):

                if s[k][i] == ".":

                    Y[k][i] = cnt

        elif s[j][i] == ".":

            cnt += 1

        elif s[j][i] == "#":

            for k in range(start, j):

                if s[k][i] == ".":

                    Y[k][i] = cnt

            start = j

            cnt = 0



XY = []

for i in range(H):

    for j in range(W):

        XY.append(X[i][j] + Y[i][j] - 1)



print((max(XY)))
import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

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

    S = [list(list(input().rstrip())) for _ in range(H)]



    CW = [[0] * W for _ in range(H)]

    for h in range(H):

        cnt = 0

        for w in range(W):

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

                cnt = 0

            else:

                cnt += 1

                CW[h][w] = cnt

        cnt = 0

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

            if S[h][w] == ".":

                cnt = max(cnt, CW[h][w])

                CW[h][w] = cnt

            else:

                cnt = 0



    CH = [[0] * W for _ in range(H)]

    for w in range(W):

        cnt = 0

        for h in range(H):

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

                cnt = 0

            else:

                cnt += 1

                CH[h][w] = cnt

        cnt = 0

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

            if S[h][w] == ".":

                cnt = max(cnt, CH[h][w])

                CH[h][w] = cnt

            else:

                cnt = 0



    res = 0

    for h in range(H):

        for w in range(W):

            C = CW[h][w] + CH[h][w] - 1

            res = max(res, C)

    print(res)





if __name__ == '__main__':

    resolve()

H, W = list(map(int, input().split()))
s = [list(eval(input())) for _ in range(H)]
X = [[0] * W for _ in range(H)]
for i in range(H):
    start = 0
    cnt = 0
    for j in range(W):
        if s[i][j] == "." and j == W - 1:
            cnt += 1
            for k in range(start, W):
                if s[i][k] == ".":
                    X[i][k] = cnt
        elif s[i][j] == ".":
            cnt += 1
        elif s[i][j] == "#":
            for k in range(start, j):
                if s[i][k] == ".":
                    X[i][k] = cnt
            start = j
            cnt = 0
Y = [[0] * W for _ in range(H)]
for i in range(W):
    start = 0
    cnt = 0
    for j in range(H):
        if s[j][i] == "." and j == H - 1:
            cnt += 1
            for k in range(start, H):
                if s[k][i] == ".":
                    Y[k][i] = cnt
        elif s[j][i] == ".":
            cnt += 1
        elif s[j][i] == "#":
            for k in range(start, j):
                if s[k][i] == ".":
                    Y[k][i] = cnt
            start = j
            cnt = 0
XY = []
for i in range(H):
    for j in range(W):
        XY.append(X[i][j] + Y[i][j] - 1)
print((max(XY)))

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    H, W = list(map(int, input().split()))
    S = [list(list(input().rstrip())) for _ in range(H)]
    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(list(range(W))):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0
    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(list(range(H))):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0
    res = 0
    for h in range(H):
        for w in range(W):
            C = CW[h][w] + CH[h][w] - 1
            res = max(res, C)
    print(res)


if __name__ == "__main__":
    resolve()

-H, W = list(map(int, input().split())) -s = [list(eval(input())) for _ in range(H)] -X = [[0] * W for _ in range(H)] -for i in range(H): -    start = 0 -    cnt = 0 -    for j in range(W): -        if s[i][j] == "." and j == W - 1: -            cnt += 1 -            for k in range(start, W): -                if s[i][k] == ".": -                    X[i][k] = cnt -        elif s[i][j] == ".": -            cnt += 1 -        elif s[i][j] == "#": -            for k in range(start, j): -                if s[i][k] == ".": -                    X[i][k] = cnt -            start = j -            cnt = 0 -Y = [[0] * W for _ in range(H)] -for i in range(W): -    start = 0 -    cnt = 0 -    for j in range(H): -        if s[j][i] == "." and j == H - 1: -            cnt += 1 -            for k in range(start, H): -                if s[k][i] == ".": -                    Y[k][i] = cnt -        elif s[j][i] == ".": -            cnt += 1 -        elif s[j][i] == "#": -            for k in range(start, j): -                if s[k][i] == ".": -                    Y[k][i] = cnt -            start = j -            cnt = 0 -XY = [] -for i in range(H): -    for j in range(W): -        XY.append(X[i][j] + Y[i][j] - 1) -print((max(XY))) +import sys + +sys.setrecursionlimit(10**7) +input = sys.stdin.readline +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    H, W = list(map(int, input().split())) +    S = [list(list(input().rstrip())) for _ in range(H)] +    CW = [[0] * W for _ in range(H)] +    for h in range(H): +        cnt = 0 +        for w in range(W): +            if S[h][w] == "#": +                cnt = 0 +            else: +                cnt += 1 +                CW[h][w] = cnt +        cnt = 0 +        for w in reversed(list(range(W))): +            if S[h][w] == ".": +                cnt = max(cnt, CW[h][w]) +                CW[h][w] = cnt +            else: +                cnt = 0 +    CH = [[0] * W for _ in range(H)] +    for w in range(W): +        cnt = 0 +        for h in range(H): +            if S[h][w] == "#": +                cnt = 0 +            else: +                cnt += 1 +                CH[h][w] = cnt +        cnt = 0 +        for h in reversed(list(range(H))): +            if S[h][w] == ".": +                cnt = max(cnt, CH[h][w]) +                CH[h][w] = cnt +            else: +                cnt = 0 +    res = 0 +    for h in range(H): +        for w in range(W): +            C = CW[h][w] + CH[h][w] - 1 +            res = max(res, C) +    print(res) + + +if __name__ == "__main__": +    resolve()