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

for i in range(h):
    s[i] = input()

cnt_ver = [[0] * w for _ in range(h)]
cnt_hor = [[0] * w for _ in range(h)]

# check vertical
for i in range(w):
    for j in range(h):
        if s[j][i] == "#":
            cnt_ver[j][i] = 0
        elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
        else:
            cnt_ver[j][i] = cnt_ver[j - 1][i] + 1

for i in range(w):
    for j in range(h - 1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            cnt_hor[i][j] = 0
        elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
        else:
            cnt_hor[i][j] = cnt_hor[i][j - 1] + 1

for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == "#":
            continue
        elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1]

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1)

print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w [] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [] s = [[] for _ in range(h)] s [[] for _ in range(h)] for i in range(h):
    s[i] = input() i range(h) range h s[i] = input() s[i] s i input() input [0] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * w [0] 0 w cnt_ver = [[0] * w for _ in range(h)] cnt_ver [[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 cnt_hor = [[0] * w for _ in range(h)] cnt_hor [[0] * w for _ in range(h)] for i in range(w):
    for j in range(h):
        if s[j][i] == "#":
            cnt_ver[j][i] = 0
        elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
        else:
            cnt_ver[j][i] = cnt_ver[j - 1][i] + 1 i range(w) range w for j in range(h):
        if s[j][i] == "#":
            cnt_ver[j][i] = 0
        elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
        else:
            cnt_ver[j][i] = cnt_ver[j - 1][i] + 1 j range(h) range h if s[j][i] == "#":
            cnt_ver[j][i] = 0
        elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
        else:
            cnt_ver[j][i] = cnt_ver[j - 1][i] + 1 s[j][i] == "#" s[j][i] [j] s j i "#" cnt_ver[j][i] = 0 cnt_ver[j][i] [j] cnt_ver j i 0 elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
         j - 1 < 0 or s[j - 1][i] == "#" j - 1 < 0 j - 1 j 1 0 s[j - 1][i] == "#" s[j - 1][i] [j - 1] s j - 1 j 1 i "#" cnt_ver[j][i] = 1 cnt_ver[j][i] [j] cnt_ver j i 1 cnt_ver[j][i] = cnt_ver[j - 1][i] + 1 cnt_ver[j][i] [j] cnt_ver j i cnt_ver[j - 1][i] + 1 cnt_ver[j - 1][i] [j - 1] cnt_ver j - 1 j 1 i 1 for i in range(w):
    for j in range(h - 1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal i range(w) range w for j in range(h - 1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal j range(h - 1, -1, -1) range h - 1 h 1 -1 -1 if s[j][i] == "#":
            continue
        elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal s[j][i] == "#" s[j][i] [j] s j i "#" continue elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal j + 1 < h and cnt_ver[j + 1][i] != 0 j + 1 < h j + 1 j 1 h cnt_ver[j + 1][i] != 0 cnt_ver[j + 1][i] [j + 1] cnt_ver j + 1 j 1 i 0 cnt_ver[j][i] = cnt_ver[j + 1][i] cnt_ver[j][i] [j] cnt_ver j i cnt_ver[j + 1][i] [j + 1] cnt_ver j + 1 j 1 i for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            cnt_hor[i][j] = 0
        elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
        else:
            cnt_hor[i][j] = cnt_hor[i][j - 1] + 1 i range(h) range h for j in range(w):
        if s[i][j] == "#":
            cnt_hor[i][j] = 0
        elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
        else:
            cnt_hor[i][j] = cnt_hor[i][j - 1] + 1 j range(w) range w if s[i][j] == "#":
            cnt_hor[i][j] = 0
        elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
        else:
            cnt_hor[i][j] = cnt_hor[i][j - 1] + 1 s[i][j] == "#" s[i][j] [i] s i j "#" cnt_hor[i][j] = 0 cnt_hor[i][j] [i] cnt_hor i j 0 elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
         j - 1 < 0 or s[i][j - 1] == "#" j - 1 < 0 j - 1 j 1 0 s[i][j - 1] == "#" s[i][j - 1] [i] s i j - 1 j 1 "#" cnt_hor[i][j] = 1 cnt_hor[i][j] [i] cnt_hor i j 1 cnt_hor[i][j] = cnt_hor[i][j - 1] + 1 cnt_hor[i][j] [i] cnt_hor i j cnt_hor[i][j - 1] + 1 cnt_hor[i][j - 1] [i] cnt_hor i j - 1 j 1 1 for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == "#":
            continue
        elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1] i range(h) range h for j in range(w - 1, -1, -1):
        if s[i][j] == "#":
            continue
        elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1] j range(w - 1, -1, -1) range w - 1 w 1 -1 -1 if s[i][j] == "#":
            continue
        elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1] s[i][j] == "#" s[i][j] [i] s i j "#" continue elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1] j + 1 < w and cnt_hor[i][j + 1] != 0 j + 1 < w j + 1 j 1 w cnt_hor[i][j + 1] != 0 cnt_hor[i][j + 1] [i] cnt_hor i j + 1 j 1 0 cnt_hor[i][j] = cnt_hor[i][j + 1] cnt_hor[i][j] [i] cnt_hor i j cnt_hor[i][j + 1] [i] cnt_hor i j + 1 j 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) i range(h) range h for j in range(w):
        ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) j range(w) range w ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) ans max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) max ans cnt_hor[i][j] + cnt_ver[i][j] - 1 cnt_hor[i][j] + cnt_ver[i][j] cnt_hor[i][j] [i] cnt_hor i j cnt_ver[i][j] [i] cnt_ver i j 1 print(ans) print ans w = map(int, input().split()) map(int, input().split()) w ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1) ans cnt_ver = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_ver cnt_hor = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_hor h, w = map(int, input().split()) map(int, input().split()) h ans = 0 0 ans s = [[] for _ in range(h)] [[] for _ in range(h)] s
h, w = map(int, input().split())
s = [[] for _ in range(h)]

for i in range(h):
    s[i] = input()

cnt_ver = [[0] * w for _ in range(h)]
cnt_hor = [[0] * w for _ in range(h)]

# check vertical
for i in range(w):
    for j in range(h):
        if s[j][i] == "#":
            cnt_ver[j][i] = 0
        elif j - 1 < 0 or s[j - 1][i] == "#":
            cnt_ver[j][i] = 1
        else:
            cnt_ver[j][i] = cnt_ver[j - 1][i] + 1

for i in range(w):
    for j in range(h - 1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j + 1 < h and cnt_ver[j + 1][i] != 0:
            cnt_ver[j][i] = cnt_ver[j + 1][i]

# check horizontal
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            cnt_hor[i][j] = 0
        elif j - 1 < 0 or s[i][j - 1] == "#":
            cnt_hor[i][j] = 1
        else:
            cnt_hor[i][j] = cnt_hor[i][j - 1] + 1

for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == "#":
            continue
        elif j + 1 < w and cnt_hor[i][j + 1] != 0:
            cnt_hor[i][j] = cnt_hor[i][j + 1]

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, cnt_hor[i][j] + cnt_ver[i][j] - 1)

print(ans)
