import numpy as np
 
H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1
 
L = np.zeros((H, W), int) # i,jより左のランプをてらせる数
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)
 
for w in range(W):
    if w == 0: 
        L[:,w] = S_list[:,w] # 一番左であれば、Lは1, 他の行も同じ
        R[:,W-w-1] = S_list[:,W-w-1] # 一番右であれば、Rは1, 他の行も同じ
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w] # Lは一つ左のものに1を加えたもの, 他の行も同じ
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1] # Rは一つ右のものに1を加えたもの, 他の行も同じ
 
for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0) # 行列のH,Wの中で最大のものをとる
 
print(ans) 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 _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input()) list input() input S_list = [list(input()) for _ in range(H)] S_list [list(input()) for _ in range(H)] S_list=(np.array(S_list) ==".")*1 S_list (np.array(S_list) ==".")*1 np.array(S_list) =="." np.array(S_list) np.array np array S_list "." 1 L = np.zeros((H, W), int) L np.zeros((H, W), int) np.zeros np zeros (H, W) H W int R = np.zeros((H, W), int) R np.zeros((H, W), int) np.zeros np zeros (H, W) H W int U = np.zeros((H, W), int) U np.zeros((H, W), int) np.zeros np zeros (H, W) H W int D = np.zeros((H, W), int) D np.zeros((H, W), int) np.zeros np zeros (H, W) H W int for w in range(W):
    if w == 0: 
        L[:,w] = S_list[:,w] # 一番左であれば、Lは1, 他の行も同じ
        R[:,W-w-1] = S_list[:,W-w-1] # 一番右であれば、Rは1, 他の行も同じ
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w] # Lは一つ左のものに1を加えたもの, 他の行も同じ
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1] # Rは一つ右のものに1を加えたもの, 他の行も同じ
  w range(W) range W if w == 0: 
        L[:,w] = S_list[:,w] # 一番左であれば、Lは1, 他の行も同じ
        R[:,W-w-1] = S_list[:,W-w-1] # 一番右であれば、Rは1, 他の行も同じ
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w] # Lは一つ左のものに1を加えたもの, 他の行も同じ
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1] # Rは一つ右のものに1を加えたもの, 他の行も同じ
  w == 0 w 0 L[:,w] = S_list[:,w] L[:,w] L : S_list[:,w] S_list : R[:,W-w-1] = S_list[:,W-w-1] R[:,W-w-1] R : S_list[:,W-w-1] S_list : L[:,w] = (L[:,w-1]+1) * S_list[:,w] L[:,w] L : (L[:,w-1]+1) * S_list[:,w] L[:,w-1]+1 L[:,w-1] L : 1 S_list[:,w] S_list : R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1] R[:,W-w-1] R : (R[:,W-w]+1) * S_list[:,W-w-1] R[:,W-w]+1 R[:,W-w] R : 1 S_list[:,W-w-1] S_list : for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
         h range(H) range H if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
         h == 0 h 0 U[h,:] = S_list[h,:] U[h,:] U h S_list[h,:] S_list h D[H-h-1,:] = S_list[H-h-1,:] D[H-h-1,:] D H-h-1 H-h H h 1 S_list[H-h-1,:] S_list H-h-1 H-h H h 1 U[h,:] = (U[h-1,:]+1) * S_list[h,:] U[h,:] U h (U[h-1,:]+1) * S_list[h,:] U[h-1,:]+1 U[h-1,:] U h-1 h 1 1 S_list[h,:] S_list h D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:] D[H-h-1,:] D H-h-1 H-h H h 1 (D[H-h,:]+1) * S_list[H-h-1,:] D[H-h,:]+1 D[H-h,:] D H-h H h 1 S_list[H-h-1,:] S_list H-h-1 H-h H h 1 ans = max(np.max(L+R+U+D-3), 0) ans max(np.max(L+R+U+D-3), 0) max 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 0 print(ans) print ans R = np.zeros((H, W), int) np.zeros((H, W), int) R L = np.zeros((H, W), int) np.zeros((H, W), int) L S_list=(np.array(S_list) ==".")*1 (np.array(S_list) ==".")*1 S_list W = map(int, input().split()) map(int, input().split()) W S_list = [list(input()) for _ in range(H)] [list(input()) for _ in range(H)] S_list ans = max(np.max(L+R+U+D-3), 0) max(np.max(L+R+U+D-3), 0) ans D = np.zeros((H, W), int) np.zeros((H, W), int) D H, W = map(int, input().split()) map(int, input().split()) H U = np.zeros((H, W), int) np.zeros((H, W), int) U
import numpy as np
 
H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1
 
L = np.zeros((H, W), int) # i,jより左のランプをてらせる数
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)
 
for w in range(W):
    if w == 0: 
        L[:,w] = S_list[:,w] # 一番左であれば、Lは1, 他の行も同じ
        R[:,W-w-1] = S_list[:,W-w-1] # 一番右であれば、Rは1, 他の行も同じ
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w] # Lは一つ左のものに1を加えたもの, 他の行も同じ
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1] # Rは一つ右のものに1を加えたもの, 他の行も同じ
 
for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0) # 行列のH,Wの中で最大のものをとる
 
print(ans)