import sys
import numpy as np


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


def main():
    h, w = map(int, read().split())
    s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
    left = np.zeros((h, w), dtype=int)
    right = np.zeros((h, w), dtype=int)
    up = np.zeros((h, w), dtype=int)
    down = np.zeros((h, w), dtype=int)
    left[:, 0] = s[:, 0]
    right[:, -1] = s[:, -1]
    for i in range(w - 1):
        left[:, i + 1] = (left[:, i] + 1) * s[:, i + 1]
        right[:, -i - 2] = (right[:, -i - 1] + 1) * s[:, -i - 2]
    up[0] = s[0]
    down[-1] = s[-1]
    for i in range(h - 1):
        up[i + 1] = (up[i] + 1) * s[i + 1]
        down[-i - 2] = (down[-i - 1] + 1) * s[-i - 2]
    print((left + right + up + down).max() - 3)


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


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


def main():
    h, w = map(int, read().split())
    s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
    left = np.zeros((h, w), dtype=int)
    right = np.zeros((h, w), dtype=int)
    up = np.zeros((h, w), dtype=int)
    down = np.zeros((h, w), dtype=int)
    left[:, 0] = s[:, 0]
    right[:, -1] = s[:, -1]
    for i in range(w - 1):
        left[:, i + 1] = (left[:, i] + 1) * s[:, i + 1]
        right[:, -i - 2] = (right[:, -i - 1] + 1) * s[:, -i - 2]
    up[0] = s[0]
    down[-1] = s[-1]
    for i in range(h - 1):
        up[i + 1] = (up[i] + 1) * s[i + 1]
        down[-i - 2] = (down[-i - 1] + 1) * s[-i - 2]
    print((left + right + up + down).max() - 3)


if __name__ == '__main__':
    main()
