#numpy使い、ループが2→１にする
import numpy as np
#初期入力
H,W = (int(x) for x in input().split())
map1 =[ list(input()) for i in range(H)]
map_np =(np.array(map1)==".")*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)

L[:,0] =map_np[:,0]
for i in range(1,W): # if map_np[i,j] ==1: ⇒ *map_npで１or０をかけてるから不要
    L[:,i] = (L[:,i-1] +1) *map_np[:,i]

R[:,W-1] =map_np[:,W-1]
for i in range(W-1-1,-1,-1):
    R[:,i] = (R[:,i+1] +1) *map_np[:,i]

U[0,:] =map_np[0,:]
for i in range(1,H):
    U[i,:] = (U[i-1,:] +1) *map_np[i,:]

D[H-1,:] =map_np[H-1,:]
for i in range(H-1-1,-1,-1):
    D[i,:] = (D[i+1,:] +1) *map_np[i,:]
    
ans =L +R +U +D -3
print(np.max(ans)) import numpy as np numpy int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x H,W = (int(x) for x in input().split()) H (int(x) for x in 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 map1 =[ list(input()) for i in range(H)] map1 [ list(input()) for i in range(H)] map_np =(np.array(map1)==".")*1 map_np (np.array(map1)==".")*1 np.array(map1)=="." np.array(map1) np.array np array map1 "." 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 L[:,0] =map_np[:,0] L[:,0] L : map_np[:,0] map_np : for i in range(1,W): # if map_np[i,j] ==1: ⇒ *map_npで１or０をかけてるから不要
    L[:,i] = (L[:,i-1] +1) *map_np[:,i] i range(1,W) range 1 W L[:,i] = (L[:,i-1] +1) *map_np[:,i] L[:,i] L : (L[:,i-1] +1) *map_np[:,i] L[:,i-1] +1 L[:,i-1] L : 1 map_np[:,i] map_np : R[:,W-1] =map_np[:,W-1] R[:,W-1] R : map_np[:,W-1] map_np : for i in range(W-1-1,-1,-1):
    R[:,i] = (R[:,i+1] +1) *map_np[:,i] i range(W-1-1,-1,-1) range W-1-1 W-1 W 1 1 -1 -1 R[:,i] = (R[:,i+1] +1) *map_np[:,i] R[:,i] R : (R[:,i+1] +1) *map_np[:,i] R[:,i+1] +1 R[:,i+1] R : 1 map_np[:,i] map_np : U[0,:] =map_np[0,:] U[0,:] U 0 map_np[0,:] map_np 0 for i in range(1,H):
    U[i,:] = (U[i-1,:] +1) *map_np[i,:] i range(1,H) range 1 H U[i,:] = (U[i-1,:] +1) *map_np[i,:] U[i,:] U i (U[i-1,:] +1) *map_np[i,:] U[i-1,:] +1 U[i-1,:] U i-1 i 1 1 map_np[i,:] map_np i D[H-1,:] =map_np[H-1,:] D[H-1,:] D H-1 H 1 map_np[H-1,:] map_np H-1 H 1 for i in range(H-1-1,-1,-1):
    D[i,:] = (D[i+1,:] +1) *map_np[i,:]
     i range(H-1-1,-1,-1) range H-1-1 H-1 H 1 1 -1 -1 D[i,:] = (D[i+1,:] +1) *map_np[i,:] D[i,:] D i (D[i+1,:] +1) *map_np[i,:] D[i+1,:] +1 D[i+1,:] D i+1 i 1 1 map_np[i,:] map_np i ans =L +R +U +D -3 ans L +R +U +D -3 L +R +U +D L +R +U L +R L R U D 3 print(np.max(ans)) print np.max(ans) np.max np max ans ans =L +R +U +D -3 L +R +U +D -3 ans H,W = (int(x) for x in input().split()) (int(x) for x in input().split()) H W = (int(x) for x in input().split()) (int(x) for x in input().split()) W R =np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) R U =np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) U map_np =(np.array(map1)==".")*1 (np.array(map1)==".")*1 map_np D =np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) D map1 =[ list(input()) for i in range(H)] [ list(input()) for i in range(H)] map1 L =np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) L
#numpy使い、ループが2→１にする
import numpy as np
#初期入力
H,W = (int(x) for x in input().split())
map1 =[ list(input()) for i in range(H)]
map_np =(np.array(map1)==".")*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)

L[:,0] =map_np[:,0]
for i in range(1,W): # if map_np[i,j] ==1: ⇒ *map_npで１or０をかけてるから不要
    L[:,i] = (L[:,i-1] +1) *map_np[:,i]

R[:,W-1] =map_np[:,W-1]
for i in range(W-1-1,-1,-1):
    R[:,i] = (R[:,i+1] +1) *map_np[:,i]

U[0,:] =map_np[0,:]
for i in range(1,H):
    U[i,:] = (U[i-1,:] +1) *map_np[i,:]

D[H-1,:] =map_np[H-1,:]
for i in range(H-1-1,-1,-1):
    D[i,:] = (D[i+1,:] +1) *map_np[i,:]
    
ans =L +R +U +D -3
print(np.max(ans))