from itertools import accumulate





def solve(string):

    h, w, *s = string.split()

    h, w = list(map(int, [h, w]))

    t = [[1 if __s == "#" else 0 for __s in _s] for _s in s]

    hi = [list(accumulate(_t)) for _t in t]

    vi = [list(accumulate(_t)) for _t in zip(*t)]

    hg = [list(map(len, _s.split("#"))) for _s in s]

    vg = [list(map(len, "".join(_s).split("#"))) for _s in zip(*s)]

    ans = 0

    for i in range(h):

        for j in range(w):

            ans = max(ans, hg[i][hi[i][j]] + vg[j][vi[j][i]])

    return str(ans - 1)

  

  

if __name__ == '__main__':

    n, m = list(map(int, input().split()))

    print((solve('{} {}\n'.format(n, m) + '\n'.join([eval(input()) for _ in range(n)]))))
def solve(string):

    h, w, *s = string.split()

    h, w = list(map(int, [h, w]))

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

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

    for i in range(h):

        st = 0

        c = 0

        for j in range(w):

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

                ht[i][st:j] = [c] * (j - st)

                st = j + 1

                c = 0

                continue

            c += 1

        ht[i][st:w] = [c] * (w - st)

    for i in range(w):

        st = 0

        c = 0

        for j in range(h):

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

                vt[i][st:j] = [c] * (j - st)

                st = j + 1

                c = 0

                continue

            c += 1

        vt[i][st:h] = [c] * (h - st)



    ans = 0

    for i in range(h):

        for j in range(w):

            ans = max(ans, ht[i][j] + vt[j][i])

    return str(ans - 1)





if __name__ == '__main__':

    n, m = list(map(int, input().split()))

    print((solve('{} {}\n'.format(n, m) + '\n'.join([eval(input()) for _ in range(n)]))))

from itertools import accumulate


def solve(string):
    h, w, *s = string.split()
    h, w = list(map(int, [h, w]))
    t = [[1 if __s == "#" else 0 for __s in _s] for _s in s]
    hi = [list(accumulate(_t)) for _t in t]
    vi = [list(accumulate(_t)) for _t in zip(*t)]
    hg = [list(map(len, _s.split("#"))) for _s in s]
    vg = [list(map(len, "".join(_s).split("#"))) for _s in zip(*s)]
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, hg[i][hi[i][j]] + vg[j][vi[j][i]])
    return str(ans - 1)


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))
    )

def solve(string):
    h, w, *s = string.split()
    h, w = list(map(int, [h, w]))
    ht = [[0] * w for _ in range(h)]
    vt = [[0] * h for _ in range(w)]
    for i in range(h):
        st = 0
        c = 0
        for j in range(w):
            if s[i][j] == "#":
                ht[i][st:j] = [c] * (j - st)
                st = j + 1
                c = 0
                continue
            c += 1
        ht[i][st:w] = [c] * (w - st)
    for i in range(w):
        st = 0
        c = 0
        for j in range(h):
            if s[j][i] == "#":
                vt[i][st:j] = [c] * (j - st)
                st = j + 1
                c = 0
                continue
            c += 1
        vt[i][st:h] = [c] * (h - st)
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ht[i][j] + vt[j][i])
    return str(ans - 1)


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))
    )

-from itertools import accumulate - - -    t = [[1 if __s == "#" else 0 for __s in _s] for _s in s] -    hi = [list(accumulate(_t)) for _t in t] -    vi = [list(accumulate(_t)) for _t in zip(*t)] -    hg = [list(map(len, _s.split("#"))) for _s in s] -    vg = [list(map(len, "".join(_s).split("#"))) for _s in zip(*s)] +    ht = [[0] * w for _ in range(h)] +    vt = [[0] * h for _ in range(w)] +    for i in range(h): +        st = 0 +        c = 0 +        for j in range(w): +            if s[i][j] == "#": +                ht[i][st:j] = [c] * (j - st) +                st = j + 1 +                c = 0 +                continue +            c += 1 +        ht[i][st:w] = [c] * (w - st) +    for i in range(w): +        st = 0 +        c = 0 +        for j in range(h): +            if s[j][i] == "#": +                vt[i][st:j] = [c] * (j - st) +                st = j + 1 +                c = 0 +                continue +            c += 1 +        vt[i][st:h] = [c] * (h - st) -            ans = max(ans, hg[i][hi[i][j]] + vg[j][vi[j][i]]) +            ans = max(ans, ht[i][j] + vt[j][i])