import sys
input = sys.stdin.readline

H,W = (int(x) for x in input().split())
S = [list(input()) for _ in range(H)]
memh = [[0] * W for _ in range(H)]
memv = [[0] * W for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            h = memh[i][j]
            if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
            v = memv[i][j]
            if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
            ans = max(ans,h+v-1)
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x H,W = (int(x) for x in input().split()) H (int(x) for x in 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)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W memh = [[0] * W for _ in range(H)] memh [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W memv = [[0] * W for _ in range(H)] memv [[0] * W for _ in range(H)] ans = 0 ans 0 for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            h = memh[i][j]
            if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
            v = memv[i][j]
            if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
            ans = max(ans,h+v-1) i range(H) range H for j in range(W):
        if S[i][j] == '.':
            h = memh[i][j]
            if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
            v = memv[i][j]
            if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
            ans = max(ans,h+v-1) j range(W) range W if S[i][j] == '.':
            h = memh[i][j]
            if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
            v = memv[i][j]
            if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
            ans = max(ans,h+v-1) S[i][j] == '.' S[i][j] [i] S i j '.' h = memh[i][j] h memh[i][j] [i] memh i j if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
             h == 0 h 0 stopped = False stopped False for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                 k range(W-j-1) range W-j-1 W-j W j 1 if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                 S[i][j+k+1] == '#' S[i][j+k+1] [i] S i j+k+1 j+k j k 1 '#' for l in range(k+1):
                            memh[i][j+l] = k+1
                         l range(k+1) range k+1 k 1 memh[i][j+l] = k+1 memh[i][j+l] [i] memh i j+l j l k+1 k 1 stopped = True stopped True break if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                 stopped == False stopped False for l in range(W-j):
                        memh[i][j+l] = W-j
                 l range(W-j) range W-j W j memh[i][j+l] = W-j memh[i][j+l] [i] memh i j+l j l W-j W j h = memh[i][j] h memh[i][j] [i] memh i j v = memv[i][j] v memv[i][j] [i] memv i j if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
             v == 0 v 0 stopped = False stopped False for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                 k range(H-i-1) range H-i-1 H-i H i 1 if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                 S[i+k+1][j] == '#' S[i+k+1][j] [i+k+1] S i+k+1 i+k i k 1 j '#' for l in range(k+1):
                            memv[i+l][j] = k+1
                         l range(k+1) range k+1 k 1 memv[i+l][j] = k+1 memv[i+l][j] [i+l] memv i+l i l j k+1 k 1 stopped = True stopped True break if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                 stopped == False stopped False for l in range(H-i):
                        memv[i+l][j] = H-i
                 l range(H-i) range H-i H i memv[i+l][j] = H-i memv[i+l][j] [i+l] memv i+l i l j H-i H i v = memv[i][j] v memv[i][j] [i] memv i j ans = max(ans,h+v-1) ans max(ans,h+v-1) max ans h+v-1 h+v h v 1 print(ans) print ans stopped = False False stopped stopped = False False stopped input = sys.stdin.readline sys.stdin.readline input h = memh[i][j] memh[i][j] h S = [list(input()) for _ in range(H)] [list(input()) for _ in range(H)] S memv = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] memv H,W = (int(x) for x in input().split()) (int(x) for x in input().split()) H h = memh[i][j] memh[i][j] h ans = 0 0 ans v = memv[i][j] memv[i][j] v ans = max(ans,h+v-1) max(ans,h+v-1) ans stopped = True True stopped memh = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] memh W = (int(x) for x in input().split()) (int(x) for x in input().split()) W stopped = True True stopped v = memv[i][j] memv[i][j] v
import sys
input = sys.stdin.readline

H,W = (int(x) for x in input().split())
S = [list(input()) for _ in range(H)]
memh = [[0] * W for _ in range(H)]
memv = [[0] * W for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            h = memh[i][j]
            if h == 0:
                stopped = False
                for k in range(W-j-1):
                    if S[i][j+k+1] == '#':
                        for l in range(k+1):
                            memh[i][j+l] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(W-j):
                        memh[i][j+l] = W-j
                h = memh[i][j]
            v = memv[i][j]
            if v == 0:
                stopped = False
                for k in range(H-i-1):
                    if S[i+k+1][j] == '#':
                        for l in range(k+1):
                            memv[i+l][j] = k+1
                        stopped = True
                        break
                if stopped == False:
                    for l in range(H-i):
                        memv[i+l][j] = H-i
                v = memv[i][j]
            ans = max(ans,h+v-1)
print(ans)