def main():

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

    ss = [eval(input()) for _ in range(h)]



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

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

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

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



    for j in range(h):

        for i in range(w):

            if ss[j][i] == '#':

                matd[j][i] = 0

            elif j == 0:

                matd[j][i] = 1

            else:

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



            if ss[h - j - 1][i] == '#':

                matu[h - j - 1][i] = 0

            elif h - j == h:

                matu[h - j - 1][i] = 1

            else:

                matu[h - j - 1][i] = matu[h - j][i] + 1



            if ss[j][i] == '#':

                matr[j][i] = 0

            elif i == 0:

                matr[j][i] = 1

            else:

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



            if ss[j][w - i - 1] == '#':

                matl[j][w - i - 1] = 0

            elif w - i == w:

                matl[j][w - i - 1] = 1

            else:

                matl[j][w - i - 1] = matl[j][w - i] + 1



    maxv = 0

    for j in range(h):

        for i in range(w):

            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]

            if tmp > maxv:

                maxv = tmp

    print((maxv - 3))



if __name__ == '__main__':

    main()

import sys

def input():

    return sys.stdin.readline()[:-1]



def main():

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

    ss = [eval(input()) for _ in range(h)]



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

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

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

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



    for j in range(h):

        for i in range(w):

            if ss[j][i] == '#':

                matd[j][i] = 0

            elif j == 0:

                matd[j][i] = 1

            else:

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



            if ss[h - j - 1][i] == '#':

                matu[h - j - 1][i] = 0

            elif h - j == h:

                matu[h - j - 1][i] = 1

            else:

                matu[h - j - 1][i] = matu[h - j][i] + 1



            if ss[j][i] == '#':

                matr[j][i] = 0

            elif i == 0:

                matr[j][i] = 1

            else:

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



            if ss[j][w - i - 1] == '#':

                matl[j][w - i - 1] = 0

            elif w - i == w:

                matl[j][w - i - 1] = 1

            else:

                matl[j][w - i - 1] = matl[j][w - i] + 1



    maxv = 0

    for j in range(h):

        for i in range(w):

            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]

            if tmp > maxv:

                maxv = tmp

    print((maxv - 3))



if __name__ == '__main__':

    main()

def main():
    h, w = list(map(int, input().split()))
    ss = [eval(input()) for _ in range(h)]
    matl = [[0 for _ in range(w)] for _ in range(h)]
    matr = [[0 for _ in range(w)] for _ in range(h)]
    matu = [[0 for _ in range(w)] for _ in range(h)]
    matd = [[0 for _ in range(w)] for _ in range(h)]
    for j in range(h):
        for i in range(w):
            if ss[j][i] == "#":
                matd[j][i] = 0
            elif j == 0:
                matd[j][i] = 1
            else:
                matd[j][i] = matd[j - 1][i] + 1
            if ss[h - j - 1][i] == "#":
                matu[h - j - 1][i] = 0
            elif h - j == h:
                matu[h - j - 1][i] = 1
            else:
                matu[h - j - 1][i] = matu[h - j][i] + 1
            if ss[j][i] == "#":
                matr[j][i] = 0
            elif i == 0:
                matr[j][i] = 1
            else:
                matr[j][i] = matr[j][i - 1] + 1
            if ss[j][w - i - 1] == "#":
                matl[j][w - i - 1] = 0
            elif w - i == w:
                matl[j][w - i - 1] = 1
            else:
                matl[j][w - i - 1] = matl[j][w - i] + 1
    maxv = 0
    for j in range(h):
        for i in range(w):
            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]
            if tmp > maxv:
                maxv = tmp
    print((maxv - 3))


if __name__ == "__main__":
    main()

import sys


def input():
    return sys.stdin.readline()[:-1]


def main():
    h, w = list(map(int, input().split()))
    ss = [eval(input()) for _ in range(h)]
    matl = [[0 for _ in range(w)] for _ in range(h)]
    matr = [[0 for _ in range(w)] for _ in range(h)]
    matu = [[0 for _ in range(w)] for _ in range(h)]
    matd = [[0 for _ in range(w)] for _ in range(h)]
    for j in range(h):
        for i in range(w):
            if ss[j][i] == "#":
                matd[j][i] = 0
            elif j == 0:
                matd[j][i] = 1
            else:
                matd[j][i] = matd[j - 1][i] + 1
            if ss[h - j - 1][i] == "#":
                matu[h - j - 1][i] = 0
            elif h - j == h:
                matu[h - j - 1][i] = 1
            else:
                matu[h - j - 1][i] = matu[h - j][i] + 1
            if ss[j][i] == "#":
                matr[j][i] = 0
            elif i == 0:
                matr[j][i] = 1
            else:
                matr[j][i] = matr[j][i - 1] + 1
            if ss[j][w - i - 1] == "#":
                matl[j][w - i - 1] = 0
            elif w - i == w:
                matl[j][w - i - 1] = 1
            else:
                matl[j][w - i - 1] = matl[j][w - i] + 1
    maxv = 0
    for j in range(h):
        for i in range(w):
            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]
            if tmp > maxv:
                maxv = tmp
    print((maxv - 3))


if __name__ == "__main__":
    main()

+import sys + + +def input(): +    return sys.stdin.readline()[:-1] + +