h, w = map(int, input().split())
s = []
for i in range(h):
    s.append(list(input()))
lr = [[0] * w for i in range(h)]
#print(lr)
for i in range(h):
    cnt = 0
    lis = []
    for j in range(w):

        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for j in range(w):
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            lr[i][j] = lis[p]
        else:
            p += 1
#print(lr)

ud = [[0] * w for i in range(h)]
#print(ud)
for j in range(w):
    cnt = 0
    lis = []
    for i in range(h):
        #print(s[i][j])
        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for i in range(h):
        #print(p,i,j,)
        #print(lis[p])
        #print(ud[j][i])
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            ud[i][j] = lis[p]
        else:
            p += 1
        #print(p)
#print(ud)
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, lr[i][j] + ud[i][j] - 1)
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = [] s [] for i in range(h):
    s.append(list(input())) i range(h) range h s.append(list(input())) s.append s append list(input()) list input() input [0] * w for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0] * w [0] 0 w lr = [[0] * w for i in range(h)] lr [[0] * w for i in range(h)] for i in range(h):
    cnt = 0
    lis = []
    for j in range(w):

        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for j in range(w):
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            lr[i][j] = lis[p]
        else:
            p += 1
#print(lr) i range(h) range h cnt = 0 cnt 0 lis = [] lis [] for j in range(w):

        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
     j range(w) range w if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
     s[i][j] == '#' s[i][j] [i] s i j '#' lis.append(cnt) lis.append lis append cnt cnt = 0 cnt 0 elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
         j == w-1 j w-1 w 1 if s[i][j] == '.':
                cnt += 1
             s[i][j] == '.' s[i][j] [i] s i j '.' cnt += 1 cnt 1 lis.append(cnt) lis.append lis append cnt cnt += 1 cnt 1 p = 0 p 0 for j in range(w):
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            lr[i][j] = lis[p]
        else:
            p += 1
#print(lr) j range(w) range w if s[i][j] == '.':
            #print(p)
            #print(lr)
            lr[i][j] = lis[p]
        else:
            p += 1
#print(lr) s[i][j] == '.' s[i][j] [i] s i j '.' lr[i][j] = lis[p] lr[i][j] [i] lr i j lis[p] lis p p += 1 p 1 [0] * w for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0] * w [0] 0 w ud = [[0] * w for i in range(h)] ud [[0] * w for i in range(h)] for j in range(w):
    cnt = 0
    lis = []
    for i in range(h):
        #print(s[i][j])
        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for i in range(h):
        #print(p,i,j,)
        #print(lis[p])
        #print(ud[j][i])
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            ud[i][j] = lis[p]
        else:
            p += 1
        #print(p)
#print(ud) j range(w) range w cnt = 0 cnt 0 lis = [] lis [] for i in range(h):
        #print(s[i][j])
        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
     i range(h) range h if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
     s[i][j] == '#' s[i][j] [i] s i j '#' lis.append(cnt) lis.append lis append cnt cnt = 0 cnt 0 elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
         i == h-1 i h-1 h 1 if s[i][j] == '.':
                cnt += 1
             s[i][j] == '.' s[i][j] [i] s i j '.' cnt += 1 cnt 1 lis.append(cnt) lis.append lis append cnt cnt += 1 cnt 1 p = 0 p 0 for i in range(h):
        #print(p,i,j,)
        #print(lis[p])
        #print(ud[j][i])
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            ud[i][j] = lis[p]
        else:
            p += 1
        #print(p)
#print(ud) i range(h) range h if s[i][j] == '.':
            #print(p)
            #print(lr)
            ud[i][j] = lis[p]
        else:
            p += 1
        #print(p)
#print(ud) s[i][j] == '.' s[i][j] [i] s i j '.' ud[i][j] = lis[p] ud[i][j] [i] ud i j lis[p] lis p p += 1 p 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, lr[i][j] + ud[i][j] - 1) i range(h) range h for j in range(w):
        ans = max(ans, lr[i][j] + ud[i][j] - 1) j range(w) range w ans = max(ans, lr[i][j] + ud[i][j] - 1) ans max(ans, lr[i][j] + ud[i][j] - 1) max ans lr[i][j] + ud[i][j] - 1 lr[i][j] + ud[i][j] lr[i][j] [i] lr i j ud[i][j] [i] ud i j 1 print(ans) print ans ans = max(ans, lr[i][j] + ud[i][j] - 1) max(ans, lr[i][j] + ud[i][j] - 1) ans w = map(int, input().split()) map(int, input().split()) w cnt = 0 0 cnt p += 1 1 p lis = [] [] lis p = 0 0 p p += 1 1 p cnt = 0 0 cnt lr = [[0] * w for i in range(h)] [[0] * w for i in range(h)] lr h, w = map(int, input().split()) map(int, input().split()) h cnt = 0 0 cnt lis = [] [] lis p = 0 0 p cnt += 1 1 cnt cnt += 1 1 cnt cnt = 0 0 cnt ud = [[0] * w for i in range(h)] [[0] * w for i in range(h)] ud ans = 0 0 ans s = [] [] s cnt += 1 1 cnt cnt += 1 1 cnt
h, w = map(int, input().split())
s = []
for i in range(h):
    s.append(list(input()))
lr = [[0] * w for i in range(h)]
#print(lr)
for i in range(h):
    cnt = 0
    lis = []
    for j in range(w):

        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif j == w-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for j in range(w):
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            lr[i][j] = lis[p]
        else:
            p += 1
#print(lr)

ud = [[0] * w for i in range(h)]
#print(ud)
for j in range(w):
    cnt = 0
    lis = []
    for i in range(h):
        #print(s[i][j])
        if s[i][j] == '#':
            lis.append(cnt)
            cnt = 0
        elif i == h-1:
            if s[i][j] == '.':
                cnt += 1
            lis.append(cnt)
        else:
            cnt += 1
    p = 0
    #print(lis)
    for i in range(h):
        #print(p,i,j,)
        #print(lis[p])
        #print(ud[j][i])
        if s[i][j] == '.':
            #print(p)
            #print(lr)
            ud[i][j] = lis[p]
        else:
            p += 1
        #print(p)
#print(ud)
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, lr[i][j] + ud[i][j] - 1)
print(ans)
