import numpy as np
h,w=map(int,input().split())
s=[]
for _ in range(h):
    si=input()
    si=si.replace('.', '1')
    si=si.replace('#', '0')
    s.append(list(map(int,si)))
s=np.array(s)

left=np.zeros((h,w))
right=np.zeros((h,w))
up=np.zeros((h,w))
down=np.zeros((h,w))

for i in range(w):
    if(i==0):
        left[:,i]=s[:,i]
        right[:,w-i-1]=s[:,w-i-1]
    else:
        left[:,i]=(left[:,i-1]+1)*s[:,i]
        right[:,w-i-1]=(right[:,w-i]+1)*s[:,w-i-1]

for i in range(h):
    if(i==0):
        down[i,:]=s[i,:]
        up[h-i-1,:]=s[h-i-1,:]
    else:
        down[i,:]=(down[i-1,:]+1)*s[i,:]
        up[h-i-1,:]=(up[h-i,:]+1)*s[h-i-1,:]

ans=left+right+up+down-3
print(int(np.max(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 s=[] s [] for _ in range(h):
    si=input()
    si=si.replace('.', '1')
    si=si.replace('#', '0')
    s.append(list(map(int,si))) _ range(h) range h si=input() si input() input si=si.replace('.', '1') si si.replace('.', '1') si.replace si replace '.' '1' si=si.replace('#', '0') si si.replace('#', '0') si.replace si replace '#' '0' s.append(list(map(int,si))) s.append s append list(map(int,si)) list map(int,si) map int si s=np.array(s) s np.array(s) np.array np array s left=np.zeros((h,w)) left np.zeros((h,w)) np.zeros np zeros (h,w) h w right=np.zeros((h,w)) right np.zeros((h,w)) np.zeros np zeros (h,w) h w up=np.zeros((h,w)) up np.zeros((h,w)) np.zeros np zeros (h,w) h w down=np.zeros((h,w)) down np.zeros((h,w)) np.zeros np zeros (h,w) h w for i in range(w):
    if(i==0):
        left[:,i]=s[:,i]
        right[:,w-i-1]=s[:,w-i-1]
    else:
        left[:,i]=(left[:,i-1]+1)*s[:,i]
        right[:,w-i-1]=(right[:,w-i]+1)*s[:,w-i-1] i range(w) range w if(i==0):
        left[:,i]=s[:,i]
        right[:,w-i-1]=s[:,w-i-1]
    else:
        left[:,i]=(left[:,i-1]+1)*s[:,i]
        right[:,w-i-1]=(right[:,w-i]+1)*s[:,w-i-1] i==0 i 0 left[:,i]=s[:,i] left[:,i] left : s[:,i] s : right[:,w-i-1]=s[:,w-i-1] right[:,w-i-1] right : s[:,w-i-1] s : left[:,i]=(left[:,i-1]+1)*s[:,i] left[:,i] left : (left[:,i-1]+1)*s[:,i] left[:,i-1]+1 left[:,i-1] left : 1 s[:,i] s : right[:,w-i-1]=(right[:,w-i]+1)*s[:,w-i-1] right[:,w-i-1] right : (right[:,w-i]+1)*s[:,w-i-1] right[:,w-i]+1 right[:,w-i] right : 1 s[:,w-i-1] s : for i in range(h):
    if(i==0):
        down[i,:]=s[i,:]
        up[h-i-1,:]=s[h-i-1,:]
    else:
        down[i,:]=(down[i-1,:]+1)*s[i,:]
        up[h-i-1,:]=(up[h-i,:]+1)*s[h-i-1,:] i range(h) range h if(i==0):
        down[i,:]=s[i,:]
        up[h-i-1,:]=s[h-i-1,:]
    else:
        down[i,:]=(down[i-1,:]+1)*s[i,:]
        up[h-i-1,:]=(up[h-i,:]+1)*s[h-i-1,:] i==0 i 0 down[i,:]=s[i,:] down[i,:] down i s[i,:] s i up[h-i-1,:]=s[h-i-1,:] up[h-i-1,:] up h-i-1 h-i h i 1 s[h-i-1,:] s h-i-1 h-i h i 1 down[i,:]=(down[i-1,:]+1)*s[i,:] down[i,:] down i (down[i-1,:]+1)*s[i,:] down[i-1,:]+1 down[i-1,:] down i-1 i 1 1 s[i,:] s i up[h-i-1,:]=(up[h-i,:]+1)*s[h-i-1,:] up[h-i-1,:] up h-i-1 h-i h i 1 (up[h-i,:]+1)*s[h-i-1,:] up[h-i,:]+1 up[h-i,:] up h-i h i 1 s[h-i-1,:] s h-i-1 h-i h i 1 ans=left+right+up+down-3 ans left+right+up+down-3 left+right+up+down left+right+up left+right left right up down 3 print(int(np.max(ans))) print int(np.max(ans)) int np.max(ans) np.max np max ans right=np.zeros((h,w)) np.zeros((h,w)) right si=si.replace('#', '0') si.replace('#', '0') si w=map(int,input().split()) map(int,input().split()) w si=si.replace('.', '1') si.replace('.', '1') si down=np.zeros((h,w)) np.zeros((h,w)) down ans=left+right+up+down-3 left+right+up+down-3 ans s=np.array(s) np.array(s) s s=[] [] s si=input() input() si h,w=map(int,input().split()) map(int,input().split()) h left=np.zeros((h,w)) np.zeros((h,w)) left up=np.zeros((h,w)) np.zeros((h,w)) up
import numpy as np
h,w=map(int,input().split())
s=[]
for _ in range(h):
    si=input()
    si=si.replace('.', '1')
    si=si.replace('#', '0')
    s.append(list(map(int,si)))
s=np.array(s)

left=np.zeros((h,w))
right=np.zeros((h,w))
up=np.zeros((h,w))
down=np.zeros((h,w))

for i in range(w):
    if(i==0):
        left[:,i]=s[:,i]
        right[:,w-i-1]=s[:,w-i-1]
    else:
        left[:,i]=(left[:,i-1]+1)*s[:,i]
        right[:,w-i-1]=(right[:,w-i]+1)*s[:,w-i-1]

for i in range(h):
    if(i==0):
        down[i,:]=s[i,:]
        up[h-i-1,:]=s[h-i-1,:]
    else:
        down[i,:]=(down[i-1,:]+1)*s[i,:]
        up[h-i-1,:]=(up[h-i,:]+1)*s[h-i-1,:]

ans=left+right+up+down-3
print(int(np.max(ans)))
