import sys


def read():
    return sys.stdin.readline().rstrip()


def main():
    h, w = map(int, read().split())
    s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w]
    left = [[0] * (w + 2) for _ in range(h + 2)]
    right = [[0] * (w + 2) for _ in range(h + 2)]
    up = [[0] * (w + 2) for _ in range(h + 2)]
    down = [[0] * (w + 2) for _ in range(h + 2)]
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
    c = 0
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
    print(c - 3)


if __name__ == '__main__':
    main() import sys sys def read():
    return sys.stdin.readline().rstrip() read return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    h, w = map(int, read().split())
    s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w]
    left = [[0] * (w + 2) for _ in range(h + 2)]
    right = [[0] * (w + 2) for _ in range(h + 2)]
    up = [[0] * (w + 2) for _ in range(h + 2)]
    down = [[0] * (w + 2) for _ in range(h + 2)]
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
    c = 0
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
    print(c - 3) main h, w = map(int, read().split()) h map(int, read().split()) map int read().split() ().split () read split w "w" + read() + "w" for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) "w" + read() + "w" "w" + read() "w" read() read "w" s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w] s ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w] ["#" * w] + ["w" + read() + "w" for _ in range(h)] ["#" * w] "#" * w "#" w ["w" + read() + "w" for _ in range(h)] ["w" * w] "w" * w "w" w [0] * (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) [0] * (w + 2) [0] 0 w + 2 w 2 left = [[0] * (w + 2) for _ in range(h + 2)] left [[0] * (w + 2) for _ in range(h + 2)] [0] * (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) [0] * (w + 2) [0] 0 w + 2 w 2 right = [[0] * (w + 2) for _ in range(h + 2)] right [[0] * (w + 2) for _ in range(h + 2)] [0] * (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) [0] * (w + 2) [0] 0 w + 2 w 2 up = [[0] * (w + 2) for _ in range(h + 2)] up [[0] * (w + 2) for _ in range(h + 2)] [0] * (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) [0] * (w + 2) [0] 0 w + 2 w 2 down = [[0] * (w + 2) for _ in range(h + 2)] down [[0] * (w + 2) for _ in range(h + 2)] for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
     y range(1, h + 1) range 1 h + 1 h 1 for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
     x range(1, w + 1) range 1 w + 1 w 1 if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
             s[y][x] == "." s[y][x] [y] s y x "." left[y][x] = left[y][x - 1] + 1 left[y][x] [y] left y x left[y][x - 1] + 1 left[y][x - 1] [y] left y x - 1 x 1 1 up[y][x] = up[y - 1][x] + 1 up[y][x] [y] up y x up[y - 1][x] + 1 up[y - 1][x] [y - 1] up y - 1 y 1 x 1 if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
     s[-y - 1][-x - 1] == "." s[-y - 1][-x - 1] [-y - 1] s -y - 1 -y y 1 -x - 1 -x x 1 "." right[-y - 1][-x - 1] = right[-y - 1][-x] + 1 right[-y - 1][-x - 1] [-y - 1] right -y - 1 -y y 1 -x - 1 -x x 1 right[-y - 1][-x] + 1 right[-y - 1][-x] [-y - 1] right -y - 1 -y y 1 -x x 1 down[-y - 1][-x - 1] = down[-y][-x - 1] + 1 down[-y - 1][-x - 1] [-y - 1] down -y - 1 -y y 1 -x - 1 -x x 1 down[-y][-x - 1] + 1 down[-y][-x - 1] [-y] down -y y -x - 1 -x x 1 1 c = 0 c 0 for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
     y range(1, h + 1) range 1 h + 1 h 1 for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
     x range(1, w + 1) range 1 w + 1 w 1 if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
     s[y][x] == "." s[y][x] [y] s y x "." c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c) c max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c) max left[y][x] + right[y][x] + up[y][x] + down[y][x] left[y][x] + right[y][x] + up[y][x] left[y][x] + right[y][x] left[y][x] [y] left y x right[y][x] [y] right y x up[y][x] [y] up y x down[y][x] [y] down y x c print(c - 3) print c - 3 c 3 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    h, w = map(int, read().split())
    s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w]
    left = [[0] * (w + 2) for _ in range(h + 2)]
    right = [[0] * (w + 2) for _ in range(h + 2)]
    up = [[0] * (w + 2) for _ in range(h + 2)]
    down = [[0] * (w + 2) for _ in range(h + 2)]
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
    c = 0
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
    print(c - 3) def main():
    h, w = map(int, read().split())
    s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w]
    left = [[0] * (w + 2) for _ in range(h + 2)]
    right = [[0] * (w + 2) for _ in range(h + 2)]
    up = [[0] * (w + 2) for _ in range(h + 2)]
    down = [[0] * (w + 2) for _ in range(h + 2)]
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
    c = 0
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
    print(c - 3) main def read():
    return sys.stdin.readline().rstrip() def read():
    return sys.stdin.readline().rstrip() read
import sys


def read():
    return sys.stdin.readline().rstrip()


def main():
    h, w = map(int, read().split())
    s = ["#" * w] + ["w" + read() + "w" for _ in range(h)] + ["w" * w]
    left = [[0] * (w + 2) for _ in range(h + 2)]
    right = [[0] * (w + 2) for _ in range(h + 2)]
    up = [[0] * (w + 2) for _ in range(h + 2)]
    down = [[0] * (w + 2) for _ in range(h + 2)]
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                left[y][x] = left[y][x - 1] + 1
                up[y][x] = up[y - 1][x] + 1
            if s[-y - 1][-x - 1] == ".":
                right[-y - 1][-x - 1] = right[-y - 1][-x] + 1
                down[-y - 1][-x - 1] = down[-y][-x - 1] + 1
    c = 0
    for y in range(1, h + 1):
        for x in range(1, w + 1):
            if s[y][x] == ".":
                c = max(left[y][x] + right[y][x] + up[y][x] + down[y][x], c)
    print(c - 3)


if __name__ == '__main__':
    main()
