h,w=map(int,input().split())
s=[input() for ri in range(h)]
table=[0]*(h*w)
for i in range(h):
    p=0
    pre=0
    for j in range(w):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,j):
                table[w*i+x]+=p
            p=0
        else:
            if p==0:
                pre=j
            p+=1
    else:
        if p:
            for x in range(pre,w):table[w*i+x]+=p

for j in range(w):
    p=0
    pre=0
    for i in range(h):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,i):
                table[j+w*x]+=p
            p=0
        else:
            if p==0:pre=i
            p+=1
    else:
        if p:
            for x in range(pre,h):table[j+w*x]+=p
        p=0

print(max(table)-1) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w input() for ri in range(h) for ri in range(h) ri range(h) range h for ri in range(h) input() input s=[input() for ri in range(h)] s [input() for ri in range(h)] table=[0]*(h*w) table [0]*(h*w) [0] 0 h*w h w for i in range(h):
    p=0
    pre=0
    for j in range(w):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,j):
                table[w*i+x]+=p
            p=0
        else:
            if p==0:
                pre=j
            p+=1
    else:
        if p:
            for x in range(pre,w):table[w*i+x]+=p i range(h) range h p=0 p 0 pre=0 pre 0 for j in range(w):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,j):
                table[w*i+x]+=p
            p=0
        else:
            if p==0:
                pre=j
            p+=1
    else:
        if p:
            for x in range(pre,w):table[w*i+x]+=p j range(w) range w if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,j):
                table[w*i+x]+=p
            p=0
        else:
            if p==0:
                pre=j
            p+=1
     s[i][j]=="#" s[i][j] [i] s i j "#" if p==0:continue
             p==0 p 0 for x in range(pre,j):
                table[w*i+x]+=p
             x range(pre,j) range pre j table[w*i+x]+=p table[w*i+x] table w*i+x w*i w i x p p=0 p 0 if p==0:
                pre=j
             p==0 p 0 pre=j pre j p+=1 p 1 if p:
            for x in range(pre,w):table[w*i+x]+=p p for x in range(pre,w):tab x range(pre,w) range pre w for j in range(w):
    p=0
    pre=0
    for i in range(h):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,i):
                table[j+w*x]+=p
            p=0
        else:
            if p==0:pre=i
            p+=1
    else:
        if p:
            for x in range(pre,h):table[j+w*x]+=p
        p=0 j range(w) range w p=0 p 0 pre=0 pre 0 for i in range(h):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,i):
                table[j+w*x]+=p
            p=0
        else:
            if p==0:pre=i
            p+=1
    else:
        if p:
            for x in range(pre,h):table[j+w*x]+=p
        p=0 i range(h) range h if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,i):
                table[j+w*x]+=p
            p=0
        else:
            if p==0:pre=i
            p+=1
     s[i][j]=="#" s[i][j] [i] s i j "#" if p==0:continue
             p==0 p 0 for x in range(pre,i):
                table[j+w*x]+=p
             x range(pre,i) range pre i table[j+w*x]+=p table[j+w*x] table j+w*x j w*x w x p p=0 p 0 if p==0:pre=i
             p==0 p 0 p+=1 p 1 if p:
            for x in range(pre,h):table[j+w*x]+=p
         p for x in range(pre,h):table[j+w*x]+=p
         x range(pre,h) range pre h p=0 p 0 print(max(table)-1) print max(table)-1 max(table) max table 1 p=0 0 p p=0 0 p w=map(int,input().split()) map(int,input().split()) w pre=0 0 pre pre=0 0 pre pre=j j pre h,w=map(int,input().split()) map(int,input().split()) h p+=1 1 p p=0 0 p table=[0]*(h*w) [0]*(h*w) table p=0 0 p p=0 0 p s=[input() for ri in range(h)] [input() for ri in range(h)] s p+=1 1 p
h,w=map(int,input().split())
s=[input() for ri in range(h)]
table=[0]*(h*w)
for i in range(h):
    p=0
    pre=0
    for j in range(w):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,j):
                table[w*i+x]+=p
            p=0
        else:
            if p==0:
                pre=j
            p+=1
    else:
        if p:
            for x in range(pre,w):table[w*i+x]+=p

for j in range(w):
    p=0
    pre=0
    for i in range(h):
        if s[i][j]=="#":
            if p==0:continue
            for x in range(pre,i):
                table[j+w*x]+=p
            p=0
        else:
            if p==0:pre=i
            p+=1
    else:
        if p:
            for x in range(pre,h):table[j+w*x]+=p
        p=0

print(max(table)-1)