from sys import stdin
import numpy as np
def main():
    #入力
    readline=stdin.readline
    h,w=map(int,readline().split())
    grid=[readline().strip() for _ in range(h)]
    grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)]
    grid=np.array(grid,dtype=np.int64)

    up=np.zeros((h,w),dtype="int64")
    up[0]=grid[0]
    for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
    down=np.zeros((h,w),dtype="int64")
    down[-1]=grid[-1]
    for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
    left=np.zeros((h,w),dtype="int64")
    left[:,0]=grid[:,0]
    for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
    right=np.zeros((h,w),dtype="int64")
    right[:,-1]=grid[:,-1]
    for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

    ans=(up+down+left+right-3).max()
    print(ans)
    
if __name__=="__main__":
    main() from sys import stdin import numpy as np numpy def main():
    #入力
    readline=stdin.readline
    h,w=map(int,readline().split())
    grid=[readline().strip() for _ in range(h)]
    grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)]
    grid=np.array(grid,dtype=np.int64)

    up=np.zeros((h,w),dtype="int64")
    up[0]=grid[0]
    for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
    down=np.zeros((h,w),dtype="int64")
    down[-1]=grid[-1]
    for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
    left=np.zeros((h,w),dtype="int64")
    left[:,0]=grid[:,0]
    for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
    right=np.zeros((h,w),dtype="int64")
    right[:,-1]=grid[:,-1]
    for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

    ans=(up+down+left+right-3).max()
    print(ans)
     main readline=stdin.readline readline stdin.readline stdin readline h,w=map(int,readline().split()) h map(int,readline().split()) map int readline().split() ().split () readline split w readline().strip() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) readline().strip() ().strip () readline strip grid=[readline().strip() for _ in range(h)] grid [readline().strip() for _ in range(h)] [1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [1 if grid[i][j]=="." else 0 for j in range(w)] grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)] grid [[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)] grid=np.array(grid,dtype=np.int64) grid np.array(grid,dtype=np.int64) np.array np array grid dtype=np.int64 dtype np.int64 np int64 up=np.zeros((h,w),dtype="int64") up np.zeros((h,w),dtype="int64") np.zeros np zeros (h,w) h w dtype="int64" dtype "int64" up[0]=grid[0] up[0] up 0 grid[0] grid 0 for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
     i range(1,h) range 1 h up[i]=(up[i-1]+1)*grid[i] up[i] up i (up[i-1]+1)*grid[i] up[i-1]+1 up[i-1] up i-1 i 1 1 grid[i] grid i down=np.zeros((h,w),dtype="int64") down np.zeros((h,w),dtype="int64") np.zeros np zeros (h,w) h w dtype="int64" dtype "int64" down[-1]=grid[-1] down[-1] down -1 grid[-1] grid -1 for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
     i range(h-2,-1,-1) range h-2 h 2 -1 -1 down[i]=(down[i+1]+1)*grid[i] down[i] down i (down[i+1]+1)*grid[i] down[i+1]+1 down[i+1] down i+1 i 1 1 grid[i] grid i left=np.zeros((h,w),dtype="int64") left np.zeros((h,w),dtype="int64") np.zeros np zeros (h,w) h w dtype="int64" dtype "int64" left[:,0]=grid[:,0] left[:,0] left : grid[:,0] grid : for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
     i range(1,w) range 1 w left[:,i]=(left[:,i-1]+1)*grid[:,i] left[:,i] left : (left[:,i-1]+1)*grid[:,i] left[:,i-1]+1 left[:,i-1] left : 1 grid[:,i] grid : right=np.zeros((h,w),dtype="int64") right np.zeros((h,w),dtype="int64") np.zeros np zeros (h,w) h w dtype="int64" dtype "int64" right[:,-1]=grid[:,-1] right[:,-1] right : grid[:,-1] grid : for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

     i range(w-2,-1,-1) range w-2 w 2 -1 -1 right[:,i]=(right[:,i+1]+1)*grid[:,i] right[:,i] right : (right[:,i+1]+1)*grid[:,i] right[:,i+1]+1 right[:,i+1] right : 1 grid[:,i] grid : ans=(up+down+left+right-3).max() ans (up+down+left+right-3).max() up+down+left+right-3).max up+down+left+right-3 up+down+left+right up+down+left up+down up down left right 3 max print(ans) print ans if __name__=="__main__":
    main() __name__=="__main__" __name__ "__main__" main() main def main():
    #入力
    readline=stdin.readline
    h,w=map(int,readline().split())
    grid=[readline().strip() for _ in range(h)]
    grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)]
    grid=np.array(grid,dtype=np.int64)

    up=np.zeros((h,w),dtype="int64")
    up[0]=grid[0]
    for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
    down=np.zeros((h,w),dtype="int64")
    down[-1]=grid[-1]
    for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
    left=np.zeros((h,w),dtype="int64")
    left[:,0]=grid[:,0]
    for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
    right=np.zeros((h,w),dtype="int64")
    right[:,-1]=grid[:,-1]
    for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

    ans=(up+down+left+right-3).max()
    print(ans)
     def main():
    #入力
    readline=stdin.readline
    h,w=map(int,readline().split())
    grid=[readline().strip() for _ in range(h)]
    grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)]
    grid=np.array(grid,dtype=np.int64)

    up=np.zeros((h,w),dtype="int64")
    up[0]=grid[0]
    for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
    down=np.zeros((h,w),dtype="int64")
    down[-1]=grid[-1]
    for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
    left=np.zeros((h,w),dtype="int64")
    left[:,0]=grid[:,0]
    for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
    right=np.zeros((h,w),dtype="int64")
    right[:,-1]=grid[:,-1]
    for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

    ans=(up+down+left+right-3).max()
    print(ans)
     main
from sys import stdin
import numpy as np
def main():
    #入力
    readline=stdin.readline
    h,w=map(int,readline().split())
    grid=[readline().strip() for _ in range(h)]
    grid=[[1 if grid[i][j]=="." else 0 for j in range(w)] for i in range(h)]
    grid=np.array(grid,dtype=np.int64)

    up=np.zeros((h,w),dtype="int64")
    up[0]=grid[0]
    for i in range(1,h):
        up[i]=(up[i-1]+1)*grid[i]
    
    down=np.zeros((h,w),dtype="int64")
    down[-1]=grid[-1]
    for i in range(h-2,-1,-1):
        down[i]=(down[i+1]+1)*grid[i]
    
    left=np.zeros((h,w),dtype="int64")
    left[:,0]=grid[:,0]
    for i in range(1,w):
        left[:,i]=(left[:,i-1]+1)*grid[:,i]
    
    right=np.zeros((h,w),dtype="int64")
    right[:,-1]=grid[:,-1]
    for i in range(w-2,-1,-1):
        right[:,i]=(right[:,i+1]+1)*grid[:,i]

    ans=(up+down+left+right-3).max()
    print(ans)
    
if __name__=="__main__":
    main()