h,w=map(int,input().split())
grid=[]
for _ in range(h):
    s=input()
    g=[0 if i=='#' else 1 for i in s]
    grid.append(g)
toL=[]
toR=[]
toU=[]
toD=[]
for i in range(h):
    tmpL=[]
    tmpR=[]
    tmpU=[]
    tmpD=[]
    for j in range(w):
        if grid[i][j]==0:
            tmpU.append(0)
        elif i==0:
            tmpU.append(1)
        else:
            tmpU.append(toU[i-1][j]+1)
        if grid[-i-1][j]==0:
            tmpD.append(0)
        elif i==0:
            tmpD.append(1)
        else:
            tmpD.append(toD[i-1][j]+1)
        if grid[i][j]==0:
            tmpL.append(0)
        elif j==0:
            tmpL.append(1)
        else:
            tmpL.append(tmpL[-1]+1)
        if grid[i][-j-1]==0:
            tmpR.append(0)
        elif j==0:
            tmpR.append(1)
        else:
            tmpR.append(tmpR[-1]+1)
    toL.append(tmpL)
    toR.append(tmpR[::-1])
    toU.append(tmpU)
    toD.append(tmpD)
toD=toD[::-1]
ans=0
for i in range(h):
    for j in range(w):
        ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3)
print(ans) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w grid=[] grid [] for _ in range(h):
    s=input()
    g=[0 if i=='#' else 1 for i in s]
    grid.append(g) _ range(h) range h s=input() s input() input 0 if i=='#' else 1 for i in s for i in s i s for i in s 0 if i=='#' else 1 i=='#' i '#' 0 1 g=[0 if i=='#' else 1 for i in s] g [0 if i=='#' else 1 for i in s] grid.append(g) grid.append grid append g toL=[] toL [] toR=[] toR [] toU=[] toU [] toD=[] toD [] for i in range(h):
    tmpL=[]
    tmpR=[]
    tmpU=[]
    tmpD=[]
    for j in range(w):
        if grid[i][j]==0:
            tmpU.append(0)
        elif i==0:
            tmpU.append(1)
        else:
            tmpU.append(toU[i-1][j]+1)
        if grid[-i-1][j]==0:
            tmpD.append(0)
        elif i==0:
            tmpD.append(1)
        else:
            tmpD.append(toD[i-1][j]+1)
        if grid[i][j]==0:
            tmpL.append(0)
        elif j==0:
            tmpL.append(1)
        else:
            tmpL.append(tmpL[-1]+1)
        if grid[i][-j-1]==0:
            tmpR.append(0)
        elif j==0:
            tmpR.append(1)
        else:
            tmpR.append(tmpR[-1]+1)
    toL.append(tmpL)
    toR.append(tmpR[::-1])
    toU.append(tmpU)
    toD.append(tmpD) i range(h) range h tmpL=[] tmpL [] tmpR=[] tmpR [] tmpU=[] tmpU [] tmpD=[] tmpD [] for j in range(w):
        if grid[i][j]==0:
            tmpU.append(0)
        elif i==0:
            tmpU.append(1)
        else:
            tmpU.append(toU[i-1][j]+1)
        if grid[-i-1][j]==0:
            tmpD.append(0)
        elif i==0:
            tmpD.append(1)
        else:
            tmpD.append(toD[i-1][j]+1)
        if grid[i][j]==0:
            tmpL.append(0)
        elif j==0:
            tmpL.append(1)
        else:
            tmpL.append(tmpL[-1]+1)
        if grid[i][-j-1]==0:
            tmpR.append(0)
        elif j==0:
            tmpR.append(1)
        else:
            tmpR.append(tmpR[-1]+1)
     j range(w) range w if grid[i][j]==0:
            tmpU.append(0)
        elif i==0:
            tmpU.append(1)
        else:
            tmpU.append(toU[i-1][j]+1)
         grid[i][j]==0 grid[i][j] [i] grid i j 0 tmpU.append(0) tmpU.append tmpU append 0 elif i==0:
            tmpU.append(1)
         i==0 i 0 tmpU.append(1) tmpU.append tmpU append 1 tmpU.append(toU[i-1][j]+1) tmpU.append tmpU append toU[i-1][j]+1 toU[i-1][j] [i-1] toU i-1 i 1 j 1 if grid[-i-1][j]==0:
            tmpD.append(0)
        elif i==0:
            tmpD.append(1)
        else:
            tmpD.append(toD[i-1][j]+1)
         grid[-i-1][j]==0 grid[-i-1][j] [-i-1] grid -i-1 -i i 1 j 0 tmpD.append(0) tmpD.append tmpD append 0 elif i==0:
            tmpD.append(1)
         i==0 i 0 tmpD.append(1) tmpD.append tmpD append 1 tmpD.append(toD[i-1][j]+1) tmpD.append tmpD append toD[i-1][j]+1 toD[i-1][j] [i-1] toD i-1 i 1 j 1 if grid[i][j]==0:
            tmpL.append(0)
        elif j==0:
            tmpL.append(1)
        else:
            tmpL.append(tmpL[-1]+1)
         grid[i][j]==0 grid[i][j] [i] grid i j 0 tmpL.append(0) tmpL.append tmpL append 0 elif j==0:
            tmpL.append(1)
         j==0 j 0 tmpL.append(1) tmpL.append tmpL append 1 tmpL.append(tmpL[-1]+1) tmpL.append tmpL append tmpL[-1]+1 tmpL[-1] tmpL -1 1 if grid[i][-j-1]==0:
            tmpR.append(0)
        elif j==0:
            tmpR.append(1)
        else:
            tmpR.append(tmpR[-1]+1)
     grid[i][-j-1]==0 grid[i][-j-1] [i] grid i -j-1 -j j 1 0 tmpR.append(0) tmpR.append tmpR append 0 elif j==0:
            tmpR.append(1)
         j==0 j 0 tmpR.append(1) tmpR.append tmpR append 1 tmpR.append(tmpR[-1]+1) tmpR.append tmpR append tmpR[-1]+1 tmpR[-1] tmpR -1 1 toL.append(tmpL) toL.append toL append tmpL toR.append(tmpR[::-1]) toR.append toR append tmpR[::-1] tmpR ::-1 -1 toU.append(tmpU) toU.append toU append tmpU toD.append(tmpD) toD.append toD append tmpD toD=toD[::-1] toD toD[::-1] toD ::-1 -1 ans=0 ans 0 for i in range(h):
    for j in range(w):
        ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) i range(h) range h for j in range(w):
        ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) j range(w) range w ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) ans max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) max ans toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3 toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j] toU[i][j]+toD[i][j]+toR[i][j] toU[i][j]+toD[i][j] toU[i][j] [i] toU i j toD[i][j] [i] toD i j toR[i][j] [i] toR i j toL[i][j] [i] toL i j 3 print(ans) print ans toD=toD[::-1] toD[::-1] toD ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3) ans h,w=map(int,input().split()) map(int,input().split()) h toL=[] [] toL grid=[] [] grid toR=[] [] toR toD=[] [] toD tmpD=[] [] tmpD toU=[] [] toU tmpL=[] [] tmpL tmpR=[] [] tmpR tmpU=[] [] tmpU s=input() input() s g=[0 if i=='#' else 1 for i in s] [0 if i=='#' else 1 for i in s] g w=map(int,input().split()) map(int,input().split()) w ans=0 0 ans
h,w=map(int,input().split())
grid=[]
for _ in range(h):
    s=input()
    g=[0 if i=='#' else 1 for i in s]
    grid.append(g)
toL=[]
toR=[]
toU=[]
toD=[]
for i in range(h):
    tmpL=[]
    tmpR=[]
    tmpU=[]
    tmpD=[]
    for j in range(w):
        if grid[i][j]==0:
            tmpU.append(0)
        elif i==0:
            tmpU.append(1)
        else:
            tmpU.append(toU[i-1][j]+1)
        if grid[-i-1][j]==0:
            tmpD.append(0)
        elif i==0:
            tmpD.append(1)
        else:
            tmpD.append(toD[i-1][j]+1)
        if grid[i][j]==0:
            tmpL.append(0)
        elif j==0:
            tmpL.append(1)
        else:
            tmpL.append(tmpL[-1]+1)
        if grid[i][-j-1]==0:
            tmpR.append(0)
        elif j==0:
            tmpR.append(1)
        else:
            tmpR.append(tmpR[-1]+1)
    toL.append(tmpL)
    toR.append(tmpR[::-1])
    toU.append(tmpU)
    toD.append(tmpD)
toD=toD[::-1]
ans=0
for i in range(h):
    for j in range(w):
        ans=max(ans, toU[i][j]+toD[i][j]+toR[i][j]+toL[i][j]-3)
print(ans)