import numpy as np
H,W=map(int,input().split(' '))
maze = [list(input()) for i in range(H)]
maze = (np.array(maze) == '.')*1
L=np.zeros((H,W),dtype=int)
R=np.zeros((H,W),dtype=int)
U=np.zeros((H,W),dtype=int)
D=np.zeros((H,W),dtype=int)
for i in range(W):
    if i==0:
        L[:,i]=maze[:,i]
        R[:,W-i-1]=maze[:,W-i-1]
    else:
        L[:,i]=(L[:,i-1]+1)*maze[:,i]
        R[:,W-i-1]=(R[:,W-i]+1)*maze[:,W-i-1]
for i in range(H):
    if i==0:
        U[i,:]=maze[i,:]
        D[H-i-1,:]=maze[H-i-1,:]
    else:
        U[i,:]=(U[i-1,:]+1)*maze[i,:]
        D[H-i-1,:]=(D[H-i]+1)*maze[H-i-1,:]
print(max(np.max(U+D+L+R-3),0)) import numpy as np numpy H,W=map(int,input().split(' ')) H map(int,input().split(' ')) map int input().split(' ') ().split () input split ' ' W list(input()) for i in range(H) for i in range(H) i range(H) range H for i in range(H) list(input()) list input() input maze = [list(input()) for i in range(H)] maze [list(input()) for i in range(H)] maze = (np.array(maze) == '.')*1 maze (np.array(maze) == '.')*1 np.array(maze) == '.' np.array(maze) np.array np array maze '.' 1 L=np.zeros((H,W),dtype=int) L np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int R=np.zeros((H,W),dtype=int) R np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int U=np.zeros((H,W),dtype=int) U np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int D=np.zeros((H,W),dtype=int) D np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int for i in range(W):
    if i==0:
        L[:,i]=maze[:,i]
        R[:,W-i-1]=maze[:,W-i-1]
    else:
        L[:,i]=(L[:,i-1]+1)*maze[:,i]
        R[:,W-i-1]=(R[:,W-i]+1)*maze[:,W-i-1] i range(W) range W if i==0:
        L[:,i]=maze[:,i]
        R[:,W-i-1]=maze[:,W-i-1]
    else:
        L[:,i]=(L[:,i-1]+1)*maze[:,i]
        R[:,W-i-1]=(R[:,W-i]+1)*maze[:,W-i-1] i==0 i 0 L[:,i]=maze[:,i] L[:,i] L : maze[:,i] maze : R[:,W-i-1]=maze[:,W-i-1] R[:,W-i-1] R : maze[:,W-i-1] maze : L[:,i]=(L[:,i-1]+1)*maze[:,i] L[:,i] L : (L[:,i-1]+1)*maze[:,i] L[:,i-1]+1 L[:,i-1] L : 1 maze[:,i] maze : R[:,W-i-1]=(R[:,W-i]+1)*maze[:,W-i-1] R[:,W-i-1] R : (R[:,W-i]+1)*maze[:,W-i-1] R[:,W-i]+1 R[:,W-i] R : 1 maze[:,W-i-1] maze : for i in range(H):
    if i==0:
        U[i,:]=maze[i,:]
        D[H-i-1,:]=maze[H-i-1,:]
    else:
        U[i,:]=(U[i-1,:]+1)*maze[i,:]
        D[H-i-1,:]=(D[H-i]+1)*maze[H-i-1,:] i range(H) range H if i==0:
        U[i,:]=maze[i,:]
        D[H-i-1,:]=maze[H-i-1,:]
    else:
        U[i,:]=(U[i-1,:]+1)*maze[i,:]
        D[H-i-1,:]=(D[H-i]+1)*maze[H-i-1,:] i==0 i 0 U[i,:]=maze[i,:] U[i,:] U i maze[i,:] maze i D[H-i-1,:]=maze[H-i-1,:] D[H-i-1,:] D H-i-1 H-i H i 1 maze[H-i-1,:] maze H-i-1 H-i H i 1 U[i,:]=(U[i-1,:]+1)*maze[i,:] U[i,:] U i (U[i-1,:]+1)*maze[i,:] U[i-1,:]+1 U[i-1,:] U i-1 i 1 1 maze[i,:] maze i D[H-i-1,:]=(D[H-i]+1)*maze[H-i-1,:] D[H-i-1,:] D H-i-1 H-i H i 1 (D[H-i]+1)*maze[H-i-1,:] D[H-i]+1 D[H-i] D H-i H i 1 maze[H-i-1,:] maze H-i-1 H-i H i 1 print(max(np.max(U+D+L+R-3),0)) print max(np.max(U+D+L+R-3),0) max np.max(U+D+L+R-3) np.max np max U+D+L+R-3 U+D+L+R U+D+L U+D U D L R 3 0 maze = (np.array(maze) == '.')*1 (np.array(maze) == '.')*1 maze W=map(int,input().split(' ')) map(int,input().split(' ')) W H,W=map(int,input().split(' ')) map(int,input().split(' ')) H U=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) U maze = [list(input()) for i in range(H)] [list(input()) for i in range(H)] maze R=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) R D=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) D L=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) L
import numpy as np
H,W=map(int,input().split(' '))
maze = [list(input()) for i in range(H)]
maze = (np.array(maze) == '.')*1
L=np.zeros((H,W),dtype=int)
R=np.zeros((H,W),dtype=int)
U=np.zeros((H,W),dtype=int)
D=np.zeros((H,W),dtype=int)
for i in range(W):
    if i==0:
        L[:,i]=maze[:,i]
        R[:,W-i-1]=maze[:,W-i-1]
    else:
        L[:,i]=(L[:,i-1]+1)*maze[:,i]
        R[:,W-i-1]=(R[:,W-i]+1)*maze[:,W-i-1]
for i in range(H):
    if i==0:
        U[i,:]=maze[i,:]
        D[H-i-1,:]=maze[H-i-1,:]
    else:
        U[i,:]=(U[i-1,:]+1)*maze[i,:]
        D[H-i-1,:]=(D[H-i]+1)*maze[H-i-1,:]
print(max(np.max(U+D+L+R-3),0))