# ABC129D - Lamp

import sys

input = sys.stdin.readline



def main():

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

    S = tuple(input().rstrip() for _ in range(H))

    L, R = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]

    U, D = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]

    for x1 in range(H):

        for y1 in range(W):

            if S[x1][y1] == ".":  # left and upper sides of S[i][j]

                U[x1][y1] = U[x1 - 1][y1] + 1

                L[x1][y1] = L[x1][y1 - 1] + 1

            x2, y2 = -x1 - 1, -y1 - 1

            if S[x2][y2] == ".":  # right and under sides

                D[x2][y2] = D[x2 + 1][y2] + 1

                R[x2][y2] = R[x2][y2 + 1] + 1

    ans = max(

        L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 for i in range(H) for j in range(W)

    )

    print(ans)





if __name__ == "__main__":

    main()
def slove():

    import sys

    input = sys.stdin.readline

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

    s = tuple(input().rstrip() for _ in range(H))

    L, R = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]

    U, D = [[0] * W for _ in range(H)], [[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()
# ABC129D - Lamp
import sys

input = sys.stdin.readline


def main():
    H, W = tuple(map(int, input().split()))
    S = tuple(input().rstrip() for _ in range(H))
    L, R = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]
    U, D = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]
    for x1 in range(H):
        for y1 in range(W):
            if S[x1][y1] == ".":  # left and upper sides of S[i][j]
                U[x1][y1] = U[x1 - 1][y1] + 1
                L[x1][y1] = L[x1][y1 - 1] + 1
            x2, y2 = -x1 - 1, -y1 - 1
            if S[x2][y2] == ".":  # right and under sides
                D[x2][y2] = D[x2 + 1][y2] + 1
                R[x2][y2] = R[x2][y2 + 1] + 1
    ans = max(
        L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 for i in range(H) for j in range(W)
    )
    print(ans)


if __name__ == "__main__":
    main()

def slove():
    import sys

    input = sys.stdin.readline
    H, W = tuple(map(int, input().split()))
    s = tuple(input().rstrip() for _ in range(H))
    L, R = [[0] * W for _ in range(H)], [[0] * W for _ in range(H)]
    U, D = [[0] * W for _ in range(H)], [[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()

-# ABC129D - Lamp -import sys +def slove(): +    import sys -input = sys.stdin.readline - - -def main(): +    input = sys.stdin.readline -    S = tuple(input().rstrip() for _ in range(H)) +    s = tuple(input().rstrip() for _ in range(H)) -    for x1 in range(H): -        for y1 in range(W): -            if S[x1][y1] == ".":  # left and upper sides of S[i][j] -                U[x1][y1] = U[x1 - 1][y1] + 1 -                L[x1][y1] = L[x1][y1 - 1] + 1 -            x2, y2 = -x1 - 1, -y1 - 1 -            if S[x2][y2] == ".":  # right and under sides -                D[x2][y2] = D[x2 + 1][y2] + 1 -                R[x2][y2] = R[x2][y2 + 1] + 1 -    ans = max( -        L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 for i in range(H) for j in range(W) -    ) -    print(ans) +    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) -    main() +    slove()