import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np 
def main():
    H, W = map(int, readline().split())
    G = np.zeros((H+2, W+2), np.int16)
    G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1))
    def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

    print((solve(G)+solve(G.T).T-1).max())
if __name__ == '__main__':
    main() import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines import numpy as np numpy def main():
    H, W = map(int, readline().split())
    G = np.zeros((H+2, W+2), np.int16)
    G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1))
    def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

    print((solve(G)+solve(G.T).T-1).max()) main H, W = map(int, readline().split()) H map(int, readline().split()) map int readline().split() ().split () readline split W G = np.zeros((H+2, W+2), np.int16) G np.zeros((H+2, W+2), np.int16) np.zeros np zeros (H+2, W+2) H+2 H 2 W+2 W 2 np.int16 np int16 G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1)) G[1:-1, 1:] G 1:-1 1 -1 (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1)) np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape np.frombuffer(read(H*(W+1)), dtype='B') == ord('.') np.frombuffer(read(H*(W+1)), dtype='B') np.frombuffer np frombuffer read(H*(W+1)) read H*(W+1) H W+1 W 1 dtype='B' dtype 'B' ord('.') ord '.' reshape (H, W+1) H W+1 W 1 def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

     solve left = np.zeros(G.shape, np.int16) left np.zeros(G.shape, np.int16) np.zeros np zeros G.shape G shape np.int16 np int16 for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
         i range(G.shape[0]) range G.shape[0] G.shape G shape 0 left[i, ] = np.arange(G.shape[1]) left[i, ] left i np.arange(G.shape[1]) np.arange np arange G.shape[1] G.shape G shape 1 left[G>0] = 0 left[G>0] left G>0 G 0 0 np.maximum.accumulate(left, out=left, axis=1) np.maximum.accumulate np.maximum np maximum accumulate left out=left out left axis=1 axis 1 rG = G[..., ::-1] rG G[..., ::-1] G right = np.zeros(G.shape, np.int16) right np.zeros(G.shape, np.int16) np.zeros np zeros G.shape G shape np.int16 np int16 for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
         i range(G.shape[0]) range G.shape[0] G.shape G shape 0 right[i, ] = np.arange(G.shape[1]) right[i, ] right i np.arange(G.shape[1]) np.arange np arange G.shape[1] G.shape G shape 1 right[rG>0] = 0 right[rG>0] right rG>0 rG 0 0 np.maximum.accumulate(right, out=right, axis=1) np.maximum.accumulate np.maximum np maximum accumulate right out=right out right axis=1 axis 1 right = G.shape[1] - right[..., ::-1]-1 right G.shape[1] - right[..., ::-1]-1 G.shape[1] - right[..., ::-1] G.shape[1] G.shape G shape 1 right[..., ::-1] right 1 scoreres = (right-left-1) scoreres right-left-1 right-left right left 1 scoreres[G==0] = 0 scoreres[G==0] scoreres G==0 G 0 0 return scoreres scoreres G G print((solve(G)+solve(G.T).T-1).max()) print (solve(G)+solve(G.T).T-1).max() solve(G)+solve(G.T).T-1).max solve(G)+solve(G.T).T-1 solve(G)+solve(G.T).T solve(G) solve G solve(G.T).T (G.T) solve G.T G T T 1 max if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main read = sys.stdin.buffer.read sys.stdin.buffer.read read def main():
    H, W = map(int, readline().split())
    G = np.zeros((H+2, W+2), np.int16)
    G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1))
    def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

    print((solve(G)+solve(G.T).T-1).max()) def main():
    H, W = map(int, readline().split())
    G = np.zeros((H+2, W+2), np.int16)
    G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1))
    def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

    print((solve(G)+solve(G.T).T-1).max()) main readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np 
def main():
    H, W = map(int, readline().split())
    G = np.zeros((H+2, W+2), np.int16)
    G[1:-1, 1:] = (np.frombuffer(read(H*(W+1)), dtype='B') == ord('.')).reshape((H, W+1))
    def solve(G):
        left = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]):
            left[i, ] = np.arange(G.shape[1])
        left[G>0] = 0
        np.maximum.accumulate(left, out=left, axis=1)

        rG = G[..., ::-1]
        right = np.zeros(G.shape, np.int16)
        for i in range(G.shape[0]): 
            right[i, ] = np.arange(G.shape[1])
        right[rG>0] = 0
        np.maximum.accumulate(right, out=right, axis=1)

        right = G.shape[1] - right[..., ::-1]-1
        scoreres = (right-left-1) 
        scoreres[G==0] = 0
        return scoreres

    print((solve(G)+solve(G.T).T-1).max())
if __name__ == '__main__':
    main()
