h, w = map(int, input().split())
s = [input() for _ in range(h)]

# 準備
row = [[0] * w for _ in range(h)]
col = [[0] * w for _ in range(h)]
for i in range(h):
    prev_wall = -1
    for j in range(w + 1):
        if j == w:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
        elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j

for j in range(w):
    prev_wall = -1
    for i in range(h + 1):
        if i == h:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
        elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, row[i][j] + col[i][j] - 1)
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) input() input s = [input() for _ in range(h)] s [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 row = [[0] * w for _ in range(h)] row [[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 col = [[0] * w for _ in range(h)] col [[0] * w for _ in range(h)] for i in range(h):
    prev_wall = -1
    for j in range(w + 1):
        if j == w:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
        elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j i range(h) range h prev_wall = -1 prev_wall -1 for j in range(w + 1):
        if j == w:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
        elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j j range(w + 1) range w + 1 w 1 if j == w:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
        elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j j == w j w for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
         k range(prev_wall+1, j) range prev_wall+1 prev_wall 1 j row[i][k] = j - prev_wall - 1 row[i][k] [i] row i k j - prev_wall - 1 j - prev_wall j prev_wall 1 elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j s[i][j] == '#' and j - prev_wall > 0 s[i][j] == '#' s[i][j] [i] s i j '#' j - prev_wall > 0 j - prev_wall j prev_wall 0 for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
             k range(prev_wall+1, j) range prev_wall+1 prev_wall 1 j row[i][k] = j - prev_wall - 1 row[i][k] [i] row i k j - prev_wall - 1 j - prev_wall j prev_wall 1 prev_wall = j prev_wall j for j in range(w):
    prev_wall = -1
    for i in range(h + 1):
        if i == h:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
        elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索 j range(w) range w prev_wall = -1 prev_wall -1 for i in range(h + 1):
        if i == h:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
        elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索 i range(h + 1) range h + 1 h 1 if i == h:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
        elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索 i == h i h for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
         k range(prev_wall+1, i) range prev_wall+1 prev_wall 1 i col[k][j] = i - prev_wall - 1 col[k][j] [k] col k j i - prev_wall - 1 i - prev_wall i prev_wall 1 elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索 s[i][j] == '#' and i - prev_wall > 0 s[i][j] == '#' s[i][j] [i] s i j '#' i - prev_wall > 0 i - prev_wall i prev_wall 0 for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
             k range(prev_wall+1, i) range prev_wall+1 prev_wall 1 i col[k][j] = i - prev_wall - 1 col[k][j] [k] col k j i - prev_wall - 1 i - prev_wall i prev_wall 1 prev_wall = i prev_wall i ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, row[i][j] + col[i][j] - 1) i range(h) range h for j in range(w):
        ans = max(ans, row[i][j] + col[i][j] - 1) j range(w) range w ans = max(ans, row[i][j] + col[i][j] - 1) ans max(ans, row[i][j] + col[i][j] - 1) max ans row[i][j] + col[i][j] - 1 row[i][j] + col[i][j] row[i][j] [i] row i j col[i][j] [i] col i j 1 print(ans) print ans ans = 0 0 ans row = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] row prev_wall = -1 -1 prev_wall w = map(int, input().split()) map(int, input().split()) w ans = max(ans, row[i][j] + col[i][j] - 1) max(ans, row[i][j] + col[i][j] - 1) ans h, w = map(int, input().split()) map(int, input().split()) h s = [input() for _ in range(h)] [input() for _ in range(h)] s prev_wall = -1 -1 prev_wall prev_wall = j j prev_wall col = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] col prev_wall = i i prev_wall
h, w = map(int, input().split())
s = [input() for _ in range(h)]

# 準備
row = [[0] * w for _ in range(h)]
col = [[0] * w for _ in range(h)]
for i in range(h):
    prev_wall = -1
    for j in range(w + 1):
        if j == w:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
        elif s[i][j] == '#' and j - prev_wall > 0:
            for k in range(prev_wall+1, j):
                row[i][k] = j - prev_wall - 1
            prev_wall = j

for j in range(w):
    prev_wall = -1
    for i in range(h + 1):
        if i == h:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
        elif s[i][j] == '#' and i - prev_wall > 0:
            for k in range(prev_wall+1, i):
                col[k][j] = i - prev_wall - 1
            prev_wall = i

# 全探索
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, row[i][j] + col[i][j] - 1)
print(ans)
