def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    s = [input().rstrip() for _ in range(H)]

    def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

    g = wallen(s)
    # print(*g, sep='\n')

    left = [[-1] * (W + 2) for _ in range(H + 2)]  # 各方向に移動したときにぶつかる障害物の位置
    right = [[-1] * (W + 2) for _ in range(H + 2)]
    up = [[-1] * (W + 2) for _ in range(H + 2)]
    down = [[-1] * (W + 2) for _ in range(H + 2)]

    for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

    for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

    ans = 0
    for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

    print(ans)


if __name__ == '__main__':
    main() def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    s = [input().rstrip() for _ in range(H)]

    def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

    g = wallen(s)
    # print(*g, sep='\n')

    left = [[-1] * (W + 2) for _ in range(H + 2)]  # 各方向に移動したときにぶつかる障害物の位置
    right = [[-1] * (W + 2) for _ in range(H + 2)]
    up = [[-1] * (W + 2) for _ in range(H + 2)]
    down = [[-1] * (W + 2) for _ in range(H + 2)]

    for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

    for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

    ans = 0
    for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

    print(ans) main import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W input().rstrip() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input().rstrip() ().rstrip () input rstrip s = [input().rstrip() for _ in range(H)] s [input().rstrip() for _ in range(H)] def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

     wallen L = len(g[0]) L len(g[0]) len g[0] g 0 ret = [] ret [] ret.append('#' * (L + 2)) ret.append ret append '#' * (L + 2) '#' L + 2 L 2 for row in g:
            t = '#' + row + '#'
            ret.append(t)
         row g t = '#' + row + '#' t '#' + row + '#' '#' + row '#' row '#' ret.append(t) ret.append ret append t ret.append('#' * (L + 2)) ret.append ret append '#' * (L + 2) '#' L + 2 L 2 return ret ret g g g = wallen(s) g wallen(s) wallen s [-1] * (W + 2) for _ in range(H + 2) for _ in range(H + 2) _ range(H + 2) range H + 2 H 2 for _ in range(H + 2) [-1] * (W + 2) [-1] -1 W + 2 W 2 left = [[-1] * (W + 2) for _ in range(H + 2)] left [[-1] * (W + 2) for _ in range(H + 2)] [-1] * (W + 2) for _ in range(H + 2) for _ in range(H + 2) _ range(H + 2) range H + 2 H 2 for _ in range(H + 2) [-1] * (W + 2) [-1] -1 W + 2 W 2 right = [[-1] * (W + 2) for _ in range(H + 2)] right [[-1] * (W + 2) for _ in range(H + 2)] [-1] * (W + 2) for _ in range(H + 2) for _ in range(H + 2) _ range(H + 2) range H + 2 H 2 for _ in range(H + 2) [-1] * (W + 2) [-1] -1 W + 2 W 2 up = [[-1] * (W + 2) for _ in range(H + 2)] up [[-1] * (W + 2) for _ in range(H + 2)] [-1] * (W + 2) for _ in range(H + 2) for _ in range(H + 2) _ range(H + 2) range H + 2 H 2 for _ in range(H + 2) [-1] * (W + 2) [-1] -1 W + 2 W 2 down = [[-1] * (W + 2) for _ in range(H + 2)] down [[-1] * (W + 2) for _ in range(H + 2)] for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

     r range(H + 2) range H + 2 H 2 for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

         c range(W + 2) range W + 2 W 2 if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

         g[r][c] == '#' g[r][c] [r] g r c '#' left[r][c] = c left[r][c] [r] left r c c left[r][c] = left[r][c - 1] left[r][c] [r] left r c left[r][c - 1] [r] left r c - 1 c 1 for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

     c reversed(range(W + 2)) reversed range(W + 2) range W + 2 W 2 if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

     g[r][c] == '#' g[r][c] [r] g r c '#' right[r][c] = c right[r][c] [r] right r c c right[r][c] = right[r][c + 1] right[r][c] [r] right r c right[r][c + 1] [r] right r c + 1 c 1 for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

     c range(W + 2) range W + 2 W 2 for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

         r range(H + 2) range H + 2 H 2 if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

         g[r][c] == '#' g[r][c] [r] g r c '#' up[r][c] = r up[r][c] [r] up r c r up[r][c] = up[r - 1][c] up[r][c] [r] up r c up[r - 1][c] [r - 1] up r - 1 r 1 c for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

     r reversed(range(H + 2)) reversed range(H + 2) range H + 2 H 2 if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

     g[r][c] == '#' g[r][c] [r] g r c '#' down[r][c] = r down[r][c] [r] down r c r down[r][c] = down[r + 1][c] down[r][c] [r] down r c down[r + 1][c] [r + 1] down r + 1 r 1 c ans = 0 ans 0 for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

     r range(H + 2) range H + 2 H 2 for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

     c range(1, W + 1) range 1 W + 1 W 1 t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3 t right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3 right[r][c] - left[r][c] + down[r][c] - up[r][c] right[r][c] - left[r][c] + down[r][c] right[r][c] - left[r][c] right[r][c] [r] right r c left[r][c] [r] left r c down[r][c] [r] down r c up[r][c] [r] up r c 3 ans = max(ans, t) ans max(ans, t) max ans t print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    s = [input().rstrip() for _ in range(H)]

    def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

    g = wallen(s)
    # print(*g, sep='\n')

    left = [[-1] * (W + 2) for _ in range(H + 2)]  # 各方向に移動したときにぶつかる障害物の位置
    right = [[-1] * (W + 2) for _ in range(H + 2)]
    up = [[-1] * (W + 2) for _ in range(H + 2)]
    down = [[-1] * (W + 2) for _ in range(H + 2)]

    for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

    for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

    ans = 0
    for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

    print(ans) def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    s = [input().rstrip() for _ in range(H)]

    def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

    g = wallen(s)
    # print(*g, sep='\n')

    left = [[-1] * (W + 2) for _ in range(H + 2)]  # 各方向に移動したときにぶつかる障害物の位置
    right = [[-1] * (W + 2) for _ in range(H + 2)]
    up = [[-1] * (W + 2) for _ in range(H + 2)]
    down = [[-1] * (W + 2) for _ in range(H + 2)]

    for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

    for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

    ans = 0
    for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

    print(ans) main
def main():
    import sys
    input = sys.stdin.readline

    H, W = map(int, input().split())
    s = [input().rstrip() for _ in range(H)]

    def wallen(g):
        L = len(g[0])
        ret = []
        ret.append('#' * (L + 2))
        for row in g:
            t = '#' + row + '#'
            ret.append(t)
        ret.append('#' * (L + 2))
        return ret

    g = wallen(s)
    # print(*g, sep='\n')

    left = [[-1] * (W + 2) for _ in range(H + 2)]  # 各方向に移動したときにぶつかる障害物の位置
    right = [[-1] * (W + 2) for _ in range(H + 2)]
    up = [[-1] * (W + 2) for _ in range(H + 2)]
    down = [[-1] * (W + 2) for _ in range(H + 2)]

    for r in range(H + 2):
        for c in range(W + 2):
            if g[r][c] == '#':
                left[r][c] = c
            else:
                left[r][c] = left[r][c - 1]

        for c in reversed(range(W + 2)):
            if g[r][c] == '#':
                right[r][c] = c
            else:
                right[r][c] = right[r][c + 1]

    for c in range(W + 2):
        for r in range(H + 2):
            if g[r][c] == '#':
                up[r][c] = r
            else:
                up[r][c] = up[r - 1][c]

        for r in reversed(range(H + 2)):
            if g[r][c] == '#':
                down[r][c] = r
            else:
                down[r][c] = down[r + 1][c]

    ans = 0
    for r in range(H + 2):
        for c in range(1, W + 1):
            t = right[r][c] - left[r][c] + down[r][c] - up[r][c] - 3
            ans = max(ans, t)

    print(ans)


if __name__ == '__main__':
    main()
