import numpy as np

H,W=map(int,input().split())
S=np.array([list(input()) for _ in range(H)]) == "."

ups=np.zeros((H,W),dtype=int)
downs=np.zeros((H,W),dtype=int)
rights=np.zeros((H,W),dtype=int)
lefts=np.zeros((H,W),dtype=int)

for i in range(1,H):
    ups[i,:]=(ups[i-1,:]+1)*S[i-1,:]

for i in range(H-2,-1,-1):
    downs[i,:]=(downs[i+1,:]+1)*S[i+1,:]

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

for i in range(W-2,-1,-1):
    lefts[:,i]=(lefts[:,i+1]+1)*S[:,i+1]

ans=((ups+downs+lefts+rights)*S).max()+1
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=np.array([list(input()) for _ in range(H)]) == "." S np.array([list(input()) for _ in range(H)]) == "." np.array([list(input()) for _ in range(H)]) np.array np array [list(input()) for _ in range(H)] "." ups=np.zeros((H,W),dtype=int) ups np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int downs=np.zeros((H,W),dtype=int) downs np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int rights=np.zeros((H,W),dtype=int) rights np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int lefts=np.zeros((H,W),dtype=int) lefts np.zeros((H,W),dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int for i in range(1,H):
    ups[i,:]=(ups[i-1,:]+1)*S[i-1,:] i range(1,H) range 1 H ups[i,:]=(ups[i-1,:]+1)*S[i-1,:] ups[i,:] ups i (ups[i-1,:]+1)*S[i-1,:] ups[i-1,:]+1 ups[i-1,:] ups i-1 i 1 1 S[i-1,:] S i-1 i 1 for i in range(H-2,-1,-1):
    downs[i,:]=(downs[i+1,:]+1)*S[i+1,:] i range(H-2,-1,-1) range H-2 H 2 -1 -1 downs[i,:]=(downs[i+1,:]+1)*S[i+1,:] downs[i,:] downs i (downs[i+1,:]+1)*S[i+1,:] downs[i+1,:]+1 downs[i+1,:] downs i+1 i 1 1 S[i+1,:] S i+1 i 1 for i in range(1,W):
    rights[:,i]=(rights[:,i-1]+1)*S[:,i-1] i range(1,W) range 1 W rights[:,i]=(rights[:,i-1]+1)*S[:,i-1] rights[:,i] rights : (rights[:,i-1]+1)*S[:,i-1] rights[:,i-1]+1 rights[:,i-1] rights : 1 S[:,i-1] S : for i in range(W-2,-1,-1):
    lefts[:,i]=(lefts[:,i+1]+1)*S[:,i+1] i range(W-2,-1,-1) range W-2 W 2 -1 -1 lefts[:,i]=(lefts[:,i+1]+1)*S[:,i+1] lefts[:,i] lefts : (lefts[:,i+1]+1)*S[:,i+1] lefts[:,i+1]+1 lefts[:,i+1] lefts : 1 S[:,i+1] S : ans=((ups+downs+lefts+rights)*S).max()+1 ans ((ups+downs+lefts+rights)*S).max()+1 ((ups+downs+lefts+rights)*S).max() (ups+downs+lefts+rights)*S).max (ups+downs+lefts+rights)*S ups+downs+lefts+rights ups+downs+lefts ups+downs ups downs lefts rights S max 1 print(ans) print ans rights=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) rights ans=((ups+downs+lefts+rights)*S).max()+1 ((ups+downs+lefts+rights)*S).max()+1 ans S=np.array([list(input()) for _ in range(H)]) == "." np.array([list(input()) for _ in range(H)]) == "." S lefts=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) lefts W=map(int,input().split()) map(int,input().split()) W ups=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) ups downs=np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) downs H,W=map(int,input().split()) map(int,input().split()) H
import numpy as np

H,W=map(int,input().split())
S=np.array([list(input()) for _ in range(H)]) == "."

ups=np.zeros((H,W),dtype=int)
downs=np.zeros((H,W),dtype=int)
rights=np.zeros((H,W),dtype=int)
lefts=np.zeros((H,W),dtype=int)

for i in range(1,H):
    ups[i,:]=(ups[i-1,:]+1)*S[i-1,:]

for i in range(H-2,-1,-1):
    downs[i,:]=(downs[i+1,:]+1)*S[i+1,:]

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

for i in range(W-2,-1,-1):
    lefts[:,i]=(lefts[:,i+1]+1)*S[:,i+1]

ans=((ups+downs+lefts+rights)*S).max()+1
print(ans)