import sys

H,W=map(int,next(sys.stdin).split())

xs=[[0]*(W+2) for _ in range(H+2)]
ys=[[0]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
    row=next(sys.stdin)
    for j in range(1,W+1):
        if row[j-1]!='.': continue
        xs[i][j]=1+xs[i][j-1]
        ys[i][j]=1+ys[i-1][j]

ans=0
for i in range(H,0,-1):
    for j in range(W,0,-1):
        if xs[i][j]==0: continue
        x=xs[i][j]=max(xs[i][j],xs[i][j+1])
        y=ys[i][j]=max(ys[i][j],ys[i+1][j])
        ans=max(ans,x+y-1)

print(ans) import sys sys H,W=map(int,next(sys.stdin).split()) H map(int,next(sys.stdin).split()) map int next(sys.stdin).split() (sys.stdin).split (sys.stdin) next sys.stdin sys stdin split W [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 xs=[[0]*(W+2) for _ in range(H+2)] xs [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 ys=[[0]*(W+2) for _ in range(H+2)] ys [[0]*(W+2) for _ in range(H+2)] for i in range(1,H+1):
    row=next(sys.stdin)
    for j in range(1,W+1):
        if row[j-1]!='.': continue
        xs[i][j]=1+xs[i][j-1]
        ys[i][j]=1+ys[i-1][j] i range(1,H+1) range 1 H+1 H 1 row=next(sys.stdin) row next(sys.stdin) next sys.stdin sys stdin for j in range(1,W+1):
        if row[j-1]!='.': continue
        xs[i][j]=1+xs[i][j-1]
        ys[i][j]=1+ys[i-1][j] j range(1,W+1) range 1 W+1 W 1 if row[j-1]!='.': continue
         row[j-1]!='.' row[j-1] row j-1 j 1 '.' xs[i][j]=1+xs[i][j-1] xs[i][j] [i] xs i j 1+xs[i][j-1] 1 xs[i][j-1] [i] xs i j-1 j 1 ys[i][j]=1+ys[i-1][j] ys[i][j] [i] ys i j 1+ys[i-1][j] 1 ys[i-1][j] [i-1] ys i-1 i 1 j ans=0 ans 0 for i in range(H,0,-1):
    for j in range(W,0,-1):
        if xs[i][j]==0: continue
        x=xs[i][j]=max(xs[i][j],xs[i][j+1])
        y=ys[i][j]=max(ys[i][j],ys[i+1][j])
        ans=max(ans,x+y-1) i range(H,0,-1) range H 0 -1 for j in range(W,0,-1):
        if xs[i][j]==0: continue
        x=xs[i][j]=max(xs[i][j],xs[i][j+1])
        y=ys[i][j]=max(ys[i][j],ys[i+1][j])
        ans=max(ans,x+y-1) j range(W,0,-1) range W 0 -1 if xs[i][j]==0: continue
         xs[i][j]==0 xs[i][j] [i] xs i j 0 x=xs[i][j]=max(xs[i][j],xs[i][j+1]) x max(xs[i][j],xs[i][j+1]) max xs[i][j] [i] xs i j xs[i][j+1] [i] xs i j+1 j 1 =xs[i][j]=max(xs[i][j],xs[i][j+1]) xs[i][j] [i] xs i j max(xs[i][j],xs[i][j+1]) y=ys[i][j]=max(ys[i][j],ys[i+1][j]) y max(ys[i][j],ys[i+1][j]) max ys[i][j] [i] ys i j ys[i+1][j] [i+1] ys i+1 i 1 j =ys[i][j]=max(ys[i][j],ys[i+1][j]) ys[i][j] [i] ys i j max(ys[i][j],ys[i+1][j]) ans=max(ans,x+y-1) ans max(ans,x+y-1) max ans x+y-1 x+y x y 1 print(ans) print ans xs=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] xs ys=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] ys x=xs[i][j]=max(xs[i][j],xs[i][j+1]) max(xs[i][j],xs[i][j+1]) x y=ys[i][j]=max(ys[i][j],ys[i+1][j]) max(ys[i][j],ys[i+1][j]) y H,W=map(int,next(sys.stdin).split()) map(int,next(sys.stdin).split()) H ans=max(ans,x+y-1) max(ans,x+y-1) ans ans=0 0 ans row=next(sys.stdin) next(sys.stdin) row W=map(int,next(sys.stdin).split()) map(int,next(sys.stdin).split()) W
import sys

H,W=map(int,next(sys.stdin).split())

xs=[[0]*(W+2) for _ in range(H+2)]
ys=[[0]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
    row=next(sys.stdin)
    for j in range(1,W+1):
        if row[j-1]!='.': continue
        xs[i][j]=1+xs[i][j-1]
        ys[i][j]=1+ys[i-1][j]

ans=0
for i in range(H,0,-1):
    for j in range(W,0,-1):
        if xs[i][j]==0: continue
        x=xs[i][j]=max(xs[i][j],xs[i][j+1])
        y=ys[i][j]=max(ys[i][j],ys[i+1][j])
        ans=max(ans,x+y-1)

print(ans)
