import numpy as np

import sys





def get_data(stream):

    buf = b''

    b = stream.buffer.read(1)

    while b != b'\n':

        buf += b

        b = stream.buffer.read(1)

    H, W = list(map(int, buf.split()))

    c = stream.buffer.read(H * (W + 1))

    arr = np.array(c.split())

    arr = np.frombuffer(arr, dtype='S1').reshape((H, W))

    return H, W, arr





def main():

    H, W, arr = get_data(sys.stdin)

    a = arr == b'.'

    L = np.empty((H, W), dtype='i8')

    R = np.empty((H, W), dtype='i8')

    T = np.empty((H, W), dtype='i8')

    B = np.empty((H, W), dtype='i8')

    T[0] = a[0]

    for i in range(1, H):

        T[i] = (T[i - 1] + 1) * a[i]

    B[-1] = a[-1]

    for i in range(H - 2, -1, -1):

        B[i] = (B[i + 1] + 1) * a[i]

    L[:, 0] = a[:, 0]

    for i in range(1, W):

        L[:, i] = (L[:, i - 1] + 1) * a[:, i]

    R[:, -1] = a[:, -1]

    for i in range(W - 2, -1, -1):

        R[:, i] = (R[:, i + 1] + 1) * a[:, i]



    print(((T + B + L + R - 3).max()))





if __name__ == "__main__":

    main()
import numpy as np

import sys





def main():

    stream = sys.stdin

    buf = stream.buffer.readline()

    H, W = list(map(int, buf.split()))

    buf = stream.buffer.read(H * (W + 1))

    arr = np.frombuffer(buf, dtype='B').reshape((H, W + 1))[:, : -1]

    a = (arr == ord('.'))

    L = np.empty((H, W), dtype='i4')

    R = np.empty((H, W), dtype='i4')

    T = np.empty((H, W), dtype='i4')

    B = np.empty((H, W), dtype='i4')

    T[0] = a[0]

    for i in range(1, H):

        T[i] = (T[i - 1] + 1) * a[i]

    B[-1] = a[-1]

    for i in range(H - 2, -1, -1):

        B[i] = (B[i + 1] + 1) * a[i]

    L[:, 0] = a[:, 0]

    for i in range(1, W):

        L[:, i] = (L[:, i - 1] + 1) * a[:, i]

    R[:, -1] = a[:, -1]

    for i in range(W - 2, -1, -1):

        R[:, i] = (R[:, i + 1] + 1) * a[:, i]



    print(((T + B + L + R - 3).max()))





main()
import numpy as np
import sys


def get_data(stream):
    buf = b""
    b = stream.buffer.read(1)
    while b != b"\n":
        buf += b
        b = stream.buffer.read(1)
    H, W = list(map(int, buf.split()))
    c = stream.buffer.read(H * (W + 1))
    arr = np.array(c.split())
    arr = np.frombuffer(arr, dtype="S1").reshape((H, W))
    return H, W, arr


def main():
    H, W, arr = get_data(sys.stdin)
    a = arr == b"."
    L = np.empty((H, W), dtype="i8")
    R = np.empty((H, W), dtype="i8")
    T = np.empty((H, W), dtype="i8")
    B = np.empty((H, W), dtype="i8")
    T[0] = a[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * a[i]
    B[-1] = a[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * a[i]
    L[:, 0] = a[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * a[:, i]
    R[:, -1] = a[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * a[:, i]
    print(((T + B + L + R - 3).max()))


if __name__ == "__main__":
    main()

import numpy as np
import sys


def main():
    stream = sys.stdin
    buf = stream.buffer.readline()
    H, W = list(map(int, buf.split()))
    buf = stream.buffer.read(H * (W + 1))
    arr = np.frombuffer(buf, dtype="B").reshape((H, W + 1))[:, :-1]
    a = arr == ord(".")
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
    T[0] = a[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * a[i]
    B[-1] = a[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * a[i]
    L[:, 0] = a[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * a[:, i]
    R[:, -1] = a[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * a[:, i]
    print(((T + B + L + R - 3).max()))


main()

-def get_data(stream): -    buf = b"" -    b = stream.buffer.read(1) -    while b != b"\n": -        buf += b -        b = stream.buffer.read(1) +def main(): +    stream = sys.stdin +    buf = stream.buffer.readline() -    c = stream.buffer.read(H * (W + 1)) -    arr = np.array(c.split()) -    arr = np.frombuffer(arr, dtype="S1").reshape((H, W)) -    return H, W, arr - - -def main(): -    H, W, arr = get_data(sys.stdin) -    a = arr == b"." -    L = np.empty((H, W), dtype="i8") -    R = np.empty((H, W), dtype="i8") -    T = np.empty((H, W), dtype="i8") -    B = np.empty((H, W), dtype="i8") +    buf = stream.buffer.read(H * (W + 1)) +    arr = np.frombuffer(buf, dtype="B").reshape((H, W + 1))[:, :-1] +    a = arr == ord(".") +    L = np.empty((H, W), dtype="i4") +    R = np.empty((H, W), dtype="i4") +    T = np.empty((H, W), dtype="i4") +    B = np.empty((H, W), dtype="i4") -if __name__ == "__main__": -    main() +main()