h,w = map(int,input().split()) 
s = [0 for i in range(h)]
s1 = [[-1 for i in range(w)]for j in range(h)]
s2 = [[-1 for i in range(w)]for j in range(h)]
ans = 0
for i in range(h):
    s[i] = list(input())
for i in range(h):
    p = 0
    d = [-1]
    for j in range(w):
        if s[i][j] == '#':
            d.append(j)
    d.append(w)
    for j in range(w):
        if s[i][j] == '.':
            s1[i][j] = d[p+1]-d[p]-1
        else:
            p += 1
for j in range(w):
    p = 0
    d = [-1]
    for i in range(h):
        if s[i][j] == '#':
            d.append(i)
    d.append(h)
    for i in range(h):
        if s[i][j] == '.':
            s2[i][j] = d[p+1]-d[p]-1
        else:
            p += 1       
for i in range(h):
    for j in range(w):
        ans =  max(ans,s1[i][j] + s2[i][j])

        
        
print(ans-1) h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w 0 for i in range(h) for i in range(h) i range(h) range h for i in range(h) 0 s = [0 for i in range(h)] s [0 for i in range(h)] [-1 for i in range(w)]for j in range(h) for j in range(h) j range(h) range h for j in range(h) [-1 for i in range(w)] s1 = [[-1 for i in range(w)]for j in range(h)] s1 [[-1 for i in range(w)]for j in range(h)] [-1 for i in range(w)]for j in range(h) for j in range(h) j range(h) range h for j in range(h) [-1 for i in range(w)] s2 = [[-1 for i in range(w)]for j in range(h)] s2 [[-1 for i in range(w)]for j in range(h)] ans = 0 ans 0 for i in range(h):
    s[i] = list(input()) i range(h) range h s[i] = list(input()) s[i] s i list(input()) list input() input for i in range(h):
    p = 0
    d = [-1]
    for j in range(w):
        if s[i][j] == '#':
            d.append(j)
    d.append(w)
    for j in range(w):
        if s[i][j] == '.':
            s1[i][j] = d[p+1]-d[p]-1
        else:
            p += 1 i range(h) range h p = 0 p 0 d = [-1] d [-1] -1 for j in range(w):
        if s[i][j] == '#':
            d.append(j)
     j range(w) range w if s[i][j] == '#':
            d.append(j)
     s[i][j] == '#' s[i][j] [i] s i j '#' d.append(j) d.append d append j d.append(w) d.append d append w for j in range(w):
        if s[i][j] == '.':
            s1[i][j] = d[p+1]-d[p]-1
        else:
            p += 1 j range(w) range w if s[i][j] == '.':
            s1[i][j] = d[p+1]-d[p]-1
        else:
            p += 1 s[i][j] == '.' s[i][j] [i] s i j '.' s1[i][j] = d[p+1]-d[p]-1 s1[i][j] [i] s1 i j d[p+1]-d[p]-1 d[p+1]-d[p] d[p+1] d p+1 p 1 d[p] d p 1 p += 1 p 1 for j in range(w):
    p = 0
    d = [-1]
    for i in range(h):
        if s[i][j] == '#':
            d.append(i)
    d.append(h)
    for i in range(h):
        if s[i][j] == '.':
            s2[i][j] = d[p+1]-d[p]-1
        else:
            p += 1        j range(w) range w p = 0 p 0 d = [-1] d [-1] -1 for i in range(h):
        if s[i][j] == '#':
            d.append(i)
     i range(h) range h if s[i][j] == '#':
            d.append(i)
     s[i][j] == '#' s[i][j] [i] s i j '#' d.append(i) d.append d append i d.append(h) d.append d append h for i in range(h):
        if s[i][j] == '.':
            s2[i][j] = d[p+1]-d[p]-1
        else:
            p += 1        i range(h) range h if s[i][j] == '.':
            s2[i][j] = d[p+1]-d[p]-1
        else:
            p += 1        s[i][j] == '.' s[i][j] [i] s i j '.' s2[i][j] = d[p+1]-d[p]-1 s2[i][j] [i] s2 i j d[p+1]-d[p]-1 d[p+1]-d[p] d[p+1] d p+1 p 1 d[p] d p 1 p += 1 p 1 for i in range(h):
    for j in range(w):
        ans =  max(ans,s1[i][j] + s2[i][j])

        
         i range(h) range h for j in range(w):
        ans =  max(ans,s1[i][j] + s2[i][j])

        
         j range(w) range w ans =  max(ans,s1[i][j] + s2[i][j]) ans max(ans,s1[i][j] + s2[i][j]) max ans s1[i][j] + s2[i][j] s1[i][j] [i] s1 i j s2[i][j] [i] s2 i j print(ans-1) print ans-1 ans 1 p += 1 1 p s1 = [[-1 for i in range(w)]for j in range(h)] [[-1 for i in range(w)]for j in range(h)] s1 h,w = map(int,input().split()) map(int,input().split()) h d = [-1] [-1] d ans = 0 0 ans s2 = [[-1 for i in range(w)]for j in range(h)] [[-1 for i in range(w)]for j in range(h)] s2 p = 0 0 p s = [0 for i in range(h)] [0 for i in range(h)] s p += 1 1 p ans =  max(ans,s1[i][j] + s2[i][j]) max(ans,s1[i][j] + s2[i][j]) ans p = 0 0 p w = map(int,input().split()) map(int,input().split()) w d = [-1] [-1] d
h,w = map(int,input().split()) 
s = [0 for i in range(h)]
s1 = [[-1 for i in range(w)]for j in range(h)]
s2 = [[-1 for i in range(w)]for j in range(h)]
ans = 0
for i in range(h):
    s[i] = list(input())
for i in range(h):
    p = 0
    d = [-1]
    for j in range(w):
        if s[i][j] == '#':
            d.append(j)
    d.append(w)
    for j in range(w):
        if s[i][j] == '.':
            s1[i][j] = d[p+1]-d[p]-1
        else:
            p += 1
for j in range(w):
    p = 0
    d = [-1]
    for i in range(h):
        if s[i][j] == '#':
            d.append(i)
    d.append(h)
    for i in range(h):
        if s[i][j] == '.':
            s2[i][j] = d[p+1]-d[p]-1
        else:
            p += 1       
for i in range(h):
    for j in range(w):
        ans =  max(ans,s1[i][j] + s2[i][j])

        
        
print(ans-1)