def main():
    import sys
    import numpy as np

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

    h, w = map(int, input().split())
    g = np.zeros((h, w), dtype=int)
    for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
    L = g.copy()
    R = g.copy()
    U = g.copy()
    D = g.copy()
    
    for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
    for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
    ans = np.max(L+R+U+D-3)
    print(ans)
            
                
if __name__ == '__main__':
    main() def main():
    import sys
    import numpy as np

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

    h, w = map(int, input().split())
    g = np.zeros((h, w), dtype=int)
    for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
    L = g.copy()
    R = g.copy()
    U = g.copy()
    D = g.copy()
    
    for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
    for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
    ans = np.max(L+R+U+D-3)
    print(ans)
            
                 main import sys sys import numpy as np numpy def input(): return sys.stdin.readline().rstrip()

     input h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w g = np.zeros((h, w), dtype=int) g np.zeros((h, w), dtype=int) np.zeros np zeros (h, w) h w dtype=int dtype int for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
     i range(h) range h int(s == '.') for s in input() for s in input() s input() input for s in input() int(s == '.') int s == '.' s '.' g[i] = [int(s == '.') for s in input()] g[i] g i [int(s == '.') for s in input()] L = g.copy() L g.copy() g.copy g copy R = g.copy() R g.copy() g.copy g copy U = g.copy() U g.copy() g.copy g copy D = g.copy() D g.copy() g.copy g copy for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
     i range(1,h) range 1 h U[i] = (U[i-1]+1)*g[i] U[i] U i (U[i-1]+1)*g[i] U[i-1]+1 U[i-1] U i-1 i 1 1 g[i] g i D[~i] = (D[~i+1]+1)*g[~i] D[~i] D ~i i (D[~i+1]+1)*g[~i] D[~i+1]+1 D[~i+1] D ~i+1 ~i i 1 1 g[~i] g ~i i for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
     j range(1, w) range 1 w L[:, j] = (L[:, j-1]+1)*g[:,j] L[:, j] L : (L[:, j-1]+1)*g[:,j] L[:, j-1]+1 L[:, j-1] L : 1 g[:,j] g : R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j] R[:, ~j] R : (R[:, ~j+1]+1)*g[:, ~j] R[:, ~j+1]+1 R[:, ~j+1] R : 1 g[:, ~j] g : ans = np.max(L+R+U+D-3) ans np.max(L+R+U+D-3) np.max np max L+R+U+D-3 L+R+U+D L+R+U L+R L R U D 3 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    import numpy as np

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

    h, w = map(int, input().split())
    g = np.zeros((h, w), dtype=int)
    for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
    L = g.copy()
    R = g.copy()
    U = g.copy()
    D = g.copy()
    
    for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
    for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
    ans = np.max(L+R+U+D-3)
    print(ans)
            
                 def main():
    import sys
    import numpy as np

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

    h, w = map(int, input().split())
    g = np.zeros((h, w), dtype=int)
    for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
    L = g.copy()
    R = g.copy()
    U = g.copy()
    D = g.copy()
    
    for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
    for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
    ans = np.max(L+R+U+D-3)
    print(ans)
            
                 main
def main():
    import sys
    import numpy as np

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

    h, w = map(int, input().split())
    g = np.zeros((h, w), dtype=int)
    for i in range(h):
        g[i] = [int(s == '.') for s in input()]
    
    L = g.copy()
    R = g.copy()
    U = g.copy()
    D = g.copy()
    
    for i in range(1,h):
        U[i] = (U[i-1]+1)*g[i]
        D[~i] = (D[~i+1]+1)*g[~i]
    for j in range(1, w):
        L[:, j] = (L[:, j-1]+1)*g[:,j]
        R[:, ~j] = (R[:, ~j+1]+1)*g[:, ~j]
     
    ans = np.max(L+R+U+D-3)
    print(ans)
            
                
if __name__ == '__main__':
    main()