def slove():

    import sys

    input = sys.stdin.readline

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

    s = [list(str(input().rstrip('\n'))) for _ in range(h)]

    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 i == 0:

                U[i][j] = 1 if s[i][j] == "." else 0

                D[-i-1][j] = 1 if s[-i-1][j] == "." else 0

            else:

                U[i][j] = U[i-1][j] + 1 if s[i][j] == "." else 0

                D[-i-1][j] = D[-i][j] + 1 if s[-i-1][j] == "." else 0

            if j == 0:

                L[i][j] = 1 if s[i][j] == "." else 0

                R[i][-j-1] = 1 if s[i][-j-1] == "." else 0

            else:

                L[i][j] = L[i][j-1] + 1 if s[i][j] == "." else 0

                R[i][-j-1] = R[i][-j] + 1 if s[i][-j-1] == "." else 0

    m_l = 0

    for i in range(h):

        for j in range(w):

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

    print(m_l)





if __name__ == '__main__':

    slove()

def slove():

    import sys

    input = sys.stdin.readline

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

    s = [list(str(input().rstrip('\n'))) for _ in range(h)]



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

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

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

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



    b = True

    for i in range(h):

        for j in range(w):

            if b:

                U[i][j] = 1 if s[i][j] != "#" else 0

                D[-i - 1][j] = 1 if s[-i - 1][j] != "#" else 0

                R[i][-j - 1] = 1 if s[i][-j - 1] != "#" else 0

                L[i][j] = 1 if s[i][j] != "#" else 0

                b = False

            else:

                U[i][j] = 1 + U[i-1][j] if s[i][j] != "#" else 0

                D[-i-1][j] = 1 + D[-i][j] if s[-i-1][j] != "#" else 0

                R[i][-j-1] = 1 + R[i][-j] if s[i][-j-1] != "#" else 0

                L[i][j] = 1 + L[i][j-1] if s[i][j] != "#" else 0

    mt = 0

    for i in range(h):

        for j in range(w):

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

    print(mt)





if __name__ == '__main__':

    slove()

def slove():
    import sys

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


if __name__ == "__main__":
    slove()

def slove():
    import sys

    input = sys.stdin.readline
    h, w = list(map(int, input().rstrip("\n").split()))
    s = [list(str(input().rstrip("\n"))) for _ in range(h)]
    U = [[0] * w for _ in range(h)]
    D = [[0] * w for _ in range(h)]
    R = [[0] * w for _ in range(h)]
    L = [[0] * w for _ in range(h)]
    b = True
    for i in range(h):
        for j in range(w):
            if b:
                U[i][j] = 1 if s[i][j] != "#" else 0
                D[-i - 1][j] = 1 if s[-i - 1][j] != "#" else 0
                R[i][-j - 1] = 1 if s[i][-j - 1] != "#" else 0
                L[i][j] = 1 if s[i][j] != "#" else 0
                b = False
            else:
                U[i][j] = 1 + U[i - 1][j] if s[i][j] != "#" else 0
                D[-i - 1][j] = 1 + D[-i][j] if s[-i - 1][j] != "#" else 0
                R[i][-j - 1] = 1 + R[i][-j] if s[i][-j - 1] != "#" else 0
                L[i][j] = 1 + L[i][j - 1] if s[i][j] != "#" else 0
    mt = 0
    for i in range(h):
        for j in range(w):
            mt = max(mt, U[i][j] + D[i][j] + R[i][j] + L[i][j] - 3)
    print(mt)


if __name__ == "__main__":
    slove()

+    U = [[0] * w for _ in range(h)] +    D = [[0] * w for _ in range(h)] -    U = [[0] * w for _ in range(h)] -    D = [[0] * w for _ in range(h)] +    b = True -            if i == 0: -                U[i][j] = 1 if s[i][j] == "." else 0 -                D[-i - 1][j] = 1 if s[-i - 1][j] == "." else 0 +            if b: +                U[i][j] = 1 if s[i][j] != "#" else 0 +                D[-i - 1][j] = 1 if s[-i - 1][j] != "#" else 0 +                R[i][-j - 1] = 1 if s[i][-j - 1] != "#" else 0 +                L[i][j] = 1 if s[i][j] != "#" else 0 +                b = False -                U[i][j] = U[i - 1][j] + 1 if s[i][j] == "." else 0 -                D[-i - 1][j] = D[-i][j] + 1 if s[-i - 1][j] == "." else 0 -            if j == 0: -                L[i][j] = 1 if s[i][j] == "." else 0 -                R[i][-j - 1] = 1 if s[i][-j - 1] == "." else 0 -            else: -                L[i][j] = L[i][j - 1] + 1 if s[i][j] == "." else 0 -                R[i][-j - 1] = R[i][-j] + 1 if s[i][-j - 1] == "." else 0 -    m_l = 0 +                U[i][j] = 1 + U[i - 1][j] if s[i][j] != "#" else 0 +                D[-i - 1][j] = 1 + D[-i][j] if s[-i - 1][j] != "#" else 0 +                R[i][-j - 1] = 1 + R[i][-j] if s[i][-j - 1] != "#" else 0 +                L[i][j] = 1 + L[i][j - 1] if s[i][j] != "#" else 0 +    mt = 0 -            m_l = max(m_l, R[i][j] + L[i][j] + U[i][j] + D[i][j] - 3) -    print(m_l) +            mt = max(mt, U[i][j] + D[i][j] + R[i][j] + L[i][j] - 3) +    print(mt)