def slove():

    import sys

    input = sys.stdin.readline

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

    lst = []

    for i in range(h):

        lst.append(list(eval(input())))



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

    L = [[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 lst[i][j] == '.':

                if j == 0:

                    L[i][j] = 1

                else:

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



    for i in range(h):

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

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

                if j == w - 1:

                    R[i][j] = 1

                else:

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



    for i in range(h):

        for j in range(w):

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

                if i == 0:

                    U[i][j] = 1

                else:

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



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

        for j in range(w):

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

                if i == h - 1:

                    D[i][j] = 1

                else:

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



    ans = 0

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

    for i in range(h):

        for j in range(w):

            x[i][j] = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3

        ans = max(ans, max(x[i]))

    print(ans)





if __name__ == '__main__':

    slove()

def slove():

    import sys

    input = sys.stdin.readline

    h, w = list(map(int, input().rstrip('\n').split()))

    s = [str(input().rstrip('\n')) 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] == "#":

                L[i][j] = 0

            else:

                if i == 0:

                    L[i][j] = 1

                else:

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

            if s[-i-1][j] == "#":

                R[-i-1][j] = 0

            else:

                if i == 0:

                    R[-i-1][j] = 1

                else:

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

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

                U[i][j] = 0

            else:

                if j == 0:

                    U[i][j] = 1

                else:

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

            if s[i][-j-1] == "#":

                D[i][-j-1] = 0

            else:

                if j == 0:

                    D[i][-j-1] = 1

                else:

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

    mn = 0

    for i in range(h):

        for j in range(w):

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

    print(mn)





if __name__ == '__main__':

    slove()

def slove():
    import sys

    input = sys.stdin.readline
    h, w = list(map(int, input().split()))
    lst = []
    for i in range(h):
        lst.append(list(eval(input())))
    R = [[0] * w for _ in range(h)]
    L = [[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 lst[i][j] == ".":
                if j == 0:
                    L[i][j] = 1
                else:
                    L[i][j] = L[i][j - 1] + 1
    for i in range(h):
        for j in range(w - 1, -1, -1):
            if lst[i][j] == ".":
                if j == w - 1:
                    R[i][j] = 1
                else:
                    R[i][j] = R[i][j + 1] + 1
    for i in range(h):
        for j in range(w):
            if lst[i][j] == ".":
                if i == 0:
                    U[i][j] = 1
                else:
                    U[i][j] = U[i - 1][j] + 1
    for i in range(h - 1, -1, -1):
        for j in range(w):
            if lst[i][j] == ".":
                if i == h - 1:
                    D[i][j] = 1
                else:
                    D[i][j] = D[i + 1][j] + 1
    ans = 0
    x = [[0] * w for _ in range(h)]
    for i in range(h):
        for j in range(w):
            x[i][j] = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3
        ans = max(ans, max(x[i]))
    print(ans)


if __name__ == "__main__":
    slove()

def slove():
    import sys

    input = sys.stdin.readline
    h, w = list(map(int, input().rstrip("\n").split()))
    s = [str(input().rstrip("\n")) 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] == "#":
                L[i][j] = 0
            else:
                if i == 0:
                    L[i][j] = 1
                else:
                    L[i][j] = L[i - 1][j] + 1
            if s[-i - 1][j] == "#":
                R[-i - 1][j] = 0
            else:
                if i == 0:
                    R[-i - 1][j] = 1
                else:
                    R[-i - 1][j] = R[-i][j] + 1
            if s[i][j] == "#":
                U[i][j] = 0
            else:
                if j == 0:
                    U[i][j] = 1
                else:
                    U[i][j] = U[i][j - 1] + 1
            if s[i][-j - 1] == "#":
                D[i][-j - 1] = 0
            else:
                if j == 0:
                    D[i][-j - 1] = 1
                else:
                    D[i][-j - 1] = D[i][-j] + 1
    mn = 0
    for i in range(h):
        for j in range(w):
            mn = max(mn, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3)
    print(mn)


if __name__ == "__main__":
    slove()

-    h, w = list(map(int, input().split())) -    lst = [] -    for i in range(h): -        lst.append(list(eval(input()))) +    h, w = list(map(int, input().rstrip("\n").split())) +    s = [str(input().rstrip("\n")) for _ in range(h)] +    L = [[0] * w for _ in range(h)] -    L = [[0] * w for _ in range(h)] -            if lst[i][j] == ".": -                if j == 0: +            if s[i][j] == "#": +                L[i][j] = 0 +            else: +                if i == 0: -                    L[i][j] = L[i][j - 1] + 1 -    for i in range(h): -        for j in range(w - 1, -1, -1): -            if lst[i][j] == ".": -                if j == w - 1: -                    R[i][j] = 1 +                    L[i][j] = L[i - 1][j] + 1 +            if s[-i - 1][j] == "#": +                R[-i - 1][j] = 0 +            else: +                if i == 0: +                    R[-i - 1][j] = 1 -                    R[i][j] = R[i][j + 1] + 1 +                    R[-i - 1][j] = R[-i][j] + 1 +            if s[i][j] == "#": +                U[i][j] = 0 +            else: +                if j == 0: +                    U[i][j] = 1 +                else: +                    U[i][j] = U[i][j - 1] + 1 +            if s[i][-j - 1] == "#": +                D[i][-j - 1] = 0 +            else: +                if j == 0: +                    D[i][-j - 1] = 1 +                else: +                    D[i][-j - 1] = D[i][-j] + 1 +    mn = 0 -            if lst[i][j] == ".": -                if i == 0: -                    U[i][j] = 1 -                else: -                    U[i][j] = U[i - 1][j] + 1 -    for i in range(h - 1, -1, -1): -        for j in range(w): -            if lst[i][j] == ".": -                if i == h - 1: -                    D[i][j] = 1 -                else: -                    D[i][j] = D[i + 1][j] + 1 -    ans = 0 -    x = [[0] * w for _ in range(h)] -    for i in range(h): -        for j in range(w): -            x[i][j] = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 -        ans = max(ans, max(x[i])) -    print(ans) +            mn = max(mn, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) +    print(mn)