h,w=map(int,input().split())
lists=[]
for i in range(h):
    s=input()
    lists.append(s)
ylists=[]
for some in lists:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(w+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    ylists.append(add)
    

            
lists1=[]
for i in range(w):
    adds=""
    for j in range(h):
        adds+=lists[j][i]
    lists1.append(adds)
    
tlists=[]
for some in lists1:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(h+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    tlists.append(add)


maximum=0
for i in range(h):
    for j in range(w):
        if ylists[i][j]==0 or tlists[j][i]==0:
            continue
        else:
            maximum=max(maximum,ylists[i][j]+tlists[j][i]-1)
print(maximum)     h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w lists=[] lists [] for i in range(h):
    s=input()
    lists.append(s) i range(h) range h s=input() s input() input lists.append(s) lists.append lists append s ylists=[] ylists [] for some in lists:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(w+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    ylists.append(add)
    

             some lists some=some+"#" some some+"#" some "#" cnt=0 cnt 0 add=[] add [] for i in range(w+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
     i range(w+1) range w+1 w 1 if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
     some[i]=="#" some[i] some i "#" if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
         cnt==0 cnt 0 add.append(0) add.append add append 0 cnt=0 cnt 0 add.extend([cnt]*cnt) add.extend add extend [cnt]*cnt [cnt] cnt cnt add.append(0) add.append add append 0 cnt=0 cnt 0 elif some[i]!="#":
            cnt+=1
     some[i]!="#" some[i] some i "#" cnt+=1 cnt 1 del add[-1] add[-1] add -1 ylists.append(add) ylists.append ylists append add lists1=[] lists1 [] for i in range(w):
    adds=""
    for j in range(h):
        adds+=lists[j][i]
    lists1.append(adds)
     i range(w) range w adds="" adds "" for j in range(h):
        adds+=lists[j][i]
     j range(h) range h adds+=lists[j][i] adds lists[j][i] [j] lists j i lists1.append(adds) lists1.append lists1 append adds tlists=[] tlists [] for some in lists1:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(h+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    tlists.append(add) some lists1 some=some+"#" some some+"#" some "#" cnt=0 cnt 0 add=[] add [] for i in range(h+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
     i range(h+1) range h+1 h 1 if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
     some[i]=="#" some[i] some i "#" if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
         cnt==0 cnt 0 add.append(0) add.append add append 0 cnt=0 cnt 0 add.extend([cnt]*cnt) add.extend add extend [cnt]*cnt [cnt] cnt cnt add.append(0) add.append add append 0 cnt=0 cnt 0 elif some[i]!="#":
            cnt+=1
     some[i]!="#" some[i] some i "#" cnt+=1 cnt 1 del add[-1] add[-1] add -1 tlists.append(add) tlists.append tlists append add maximum=0 maximum 0 for i in range(h):
    for j in range(w):
        if ylists[i][j]==0 or tlists[j][i]==0:
            continue
        else:
            maximum=max(maximum,ylists[i][j]+tlists[j][i]-1) i range(h) range h for j in range(w):
        if ylists[i][j]==0 or tlists[j][i]==0:
            continue
        else:
            maximum=max(maximum,ylists[i][j]+tlists[j][i]-1) j range(w) range w if ylists[i][j]==0 or tlists[j][i]==0:
            continue
        else:
            maximum=max(maximum,ylists[i][j]+tlists[j][i]-1) ylists[i][j]==0 or tlists[j][i]==0 ylists[i][j]==0 ylists[i][j] [i] ylists i j 0 tlists[j][i]==0 tlists[j][i] [j] tlists j i 0 continue maximum=max(maximum,ylists[i][j]+tlists[j][i]-1) maximum max(maximum,ylists[i][j]+tlists[j][i]-1) max maximum ylists[i][j]+tlists[j][i]-1 ylists[i][j]+tlists[j][i] ylists[i][j] [i] ylists i j tlists[j][i] [j] tlists j i 1 print(maximum) print maximum adds="" "" adds s=input() input() s cnt=0 0 cnt adds+=lists[j][i] lists[j][i] adds ylists=[] [] ylists add=[] [] add h,w=map(int,input().split()) map(int,input().split()) h cnt+=1 1 cnt w=map(int,input().split()) map(int,input().split()) w some=some+"#" some+"#" some lists=[] [] lists cnt=0 0 cnt cnt=0 0 cnt cnt=0 0 cnt tlists=[] [] tlists cnt=0 0 cnt maximum=0 0 maximum lists1=[] [] lists1 some=some+"#" some+"#" some add=[] [] add cnt=0 0 cnt maximum=max(maximum,ylists[i][j]+tlists[j][i]-1) max(maximum,ylists[i][j]+tlists[j][i]-1) maximum cnt+=1 1 cnt
h,w=map(int,input().split())
lists=[]
for i in range(h):
    s=input()
    lists.append(s)
ylists=[]
for some in lists:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(w+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    ylists.append(add)
    

            
lists1=[]
for i in range(w):
    adds=""
    for j in range(h):
        adds+=lists[j][i]
    lists1.append(adds)
    
tlists=[]
for some in lists1:
    some=some+"#"
    cnt=0
    add=[]
    for i in range(h+1):
        if some[i]=="#":
            if cnt==0:
                add.append(0)
                cnt=0
            else:
                add.extend([cnt]*cnt)
                add.append(0)
                cnt=0
                
        elif some[i]!="#":
            cnt+=1
    del add[-1]
    tlists.append(add)


maximum=0
for i in range(h):
    for j in range(w):
        if ylists[i][j]==0 or tlists[j][i]==0:
            continue
        else:
            maximum=max(maximum,ylists[i][j]+tlists[j][i]-1)
print(maximum)    
