from bisect import bisect as b

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

X=[]
HL=[[] for _ in range(H)]
WL=[[] for _ in range(W)]
for h in range(H):
    for w in range(W):
        if S[h][w]=="#":
            HL[h].append(w)
            WL[w].append(h)

ans=0

for h in range(H):
    for w in range(W):
        if S[h][w]==".":
            if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

            if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
            ans=max(ans,ver+hol-1)
print(ans) from bisect import bisect as b 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=[list(input()) for _ in range(H)] S [list(input()) for _ in range(H)] X=[] X [] [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] HL=[[] for _ in range(H)] HL [[] for _ in range(H)] [] for _ in range(W) for _ in range(W) _ range(W) range W for _ in range(W) [] WL=[[] for _ in range(W)] WL [[] for _ in range(W)] for h in range(H):
    for w in range(W):
        if S[h][w]=="#":
            HL[h].append(w)
            WL[w].append(h) h range(H) range H for w in range(W):
        if S[h][w]=="#":
            HL[h].append(w)
            WL[w].append(h) w range(W) range W if S[h][w]=="#":
            HL[h].append(w)
            WL[w].append(h) S[h][w]=="#" S[h][w] [h] S h w "#" HL[h].append(w) [h].append [h] HL h append w WL[w].append(h) [w].append [w] WL w append h ans=0 ans 0 for h in range(H):
    for w in range(W):
        if S[h][w]==".":
            if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

            if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
            ans=max(ans,ver+hol-1) h range(H) range H for w in range(W):
        if S[h][w]==".":
            if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

            if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
            ans=max(ans,ver+hol-1) w range(W) range W if S[h][w]==".":
            if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

            if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
            ans=max(ans,ver+hol-1) S[h][w]=="." S[h][w] [h] S h w "." if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

             len(HL[h])==0 len(HL[h]) len HL[h] HL h 0 hol=W hol W x=b(HL[h],w) x b(HL[h],w) b HL[h] HL h w N=len(HL[h]) N len(HL[h]) len HL[h] HL h if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

             x==0 x 0 hol=HL[h][x] hol HL[h][x] [h] HL h x elif x==N:
                    hol=W-1-HL[h][-1]
                 x==N x N hol=W-1-HL[h][-1] hol W-1-HL[h][-1] W-1 W 1 HL[h][-1] [h] HL h -1 hol=HL[h][x]-HL[h][x-1]-1 hol HL[h][x]-HL[h][x-1]-1 HL[h][x]-HL[h][x-1] HL[h][x] [h] HL h x HL[h][x-1] [h] HL h x-1 x 1 1 if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
             len(WL[w])==0 len(WL[w]) len WL[w] WL w 0 ver=H ver H y=b(WL[w],h) y b(WL[w],h) b WL[w] WL w h M=len(WL[w]) M len(WL[w]) len WL[w] WL w if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
             y==0 y 0 ver=WL[w][y] ver WL[w][y] [w] WL w y elif y==M:
                    ver=H-1-WL[w][-1]
                 y==M y M ver=H-1-WL[w][-1] ver H-1-WL[w][-1] H-1 H 1 WL[w][-1] [w] WL w -1 ver=WL[w][y]-WL[w][y-1]-1 ver WL[w][y]-WL[w][y-1]-1 WL[w][y]-WL[w][y-1] WL[w][y] [w] WL w y WL[w][y-1] [w] WL w y-1 y 1 1 ans=max(ans,ver+hol-1) ans max(ans,ver+hol-1) max ans ver+hol-1 ver+hol ver hol 1 print(ans) print ans ver=H H ver ver=H-1-WL[w][-1] H-1-WL[w][-1] ver X=[] [] X hol=W W hol hol=HL[h][x]-HL[h][x-1]-1 HL[h][x]-HL[h][x-1]-1 hol ans=0 0 ans hol=W-1-HL[h][-1] W-1-HL[h][-1] hol ver=WL[w][y]-WL[w][y-1]-1 WL[w][y]-WL[w][y-1]-1 ver ans=max(ans,ver+hol-1) max(ans,ver+hol-1) ans W=map(int,input().split()) map(int,input().split()) W M=len(WL[w]) len(WL[w]) M HL=[[] for _ in range(H)] [[] for _ in range(H)] HL x=b(HL[h],w) b(HL[h],w) x S=[list(input()) for _ in range(H)] [list(input()) for _ in range(H)] S ver=WL[w][y] WL[w][y] ver H,W=map(int,input().split()) map(int,input().split()) H hol=HL[h][x] HL[h][x] hol N=len(HL[h]) len(HL[h]) N WL=[[] for _ in range(W)] [[] for _ in range(W)] WL y=b(WL[w],h) b(WL[w],h) y
from bisect import bisect as b

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

X=[]
HL=[[] for _ in range(H)]
WL=[[] for _ in range(W)]
for h in range(H):
    for w in range(W):
        if S[h][w]=="#":
            HL[h].append(w)
            WL[w].append(h)

ans=0

for h in range(H):
    for w in range(W):
        if S[h][w]==".":
            if len(HL[h])==0:
                hol=W
            else:
                x=b(HL[h],w)
                N=len(HL[h])
                if x==0:
                    hol=HL[h][x]
                elif x==N:
                    hol=W-1-HL[h][-1]
                else:
                    hol=HL[h][x]-HL[h][x-1]-1

            if len(WL[w])==0:
                ver=H
            else:
                y=b(WL[w],h)
                M=len(WL[w])
                if y==0:
                    ver=WL[w][y]
                elif y==M:
                    ver=H-1-WL[w][-1]
                else:
                    ver=WL[w][y]-WL[w][y-1]-1
            ans=max(ans,ver+hol-1)
print(ans)