h, w = map(int, input().split())
tizu = [input() for _ in range(h)]
check = [[False for _ in range(w)] for _ in range(h)]
ans = [[1 for _ in range(w)] for _ in range(h)]

for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [i]
        cnt = 0
        for k in range(i + 1, h):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(i - 1, -1, -1):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[l][j] += cnt
            check[l][j] = True

check = [[False for _ in range(w)] for _ in range(h)]
max_ans = 0
for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [j]
        cnt = 0
        for k in range(j + 1, w):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(j - 1, -1, -1):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[i][l] += cnt
            check[i][l] = True
            max_ans = max(max_ans, ans[i][l])
print(max_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 tizu = [input() for _ in range(h)] tizu [input() for _ in range(h)] [False for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [False for _ in range(w)] check = [[False for _ in range(w)] for _ in range(h)] check [[False for _ in range(w)] for _ in range(h)] [1 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1 for _ in range(w)] ans = [[1 for _ in range(w)] for _ in range(h)] ans [[1 for _ in range(w)] for _ in range(h)] for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [i]
        cnt = 0
        for k in range(i + 1, h):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(i - 1, -1, -1):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[l][j] += cnt
            check[l][j] = True i range(h) range h for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [i]
        cnt = 0
        for k in range(i + 1, h):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(i - 1, -1, -1):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[l][j] += cnt
            check[l][j] = True j range(w) range w if check[i][j]:
            continue
         check[i][j] [i] check i j continue if tizu[i][j] == "#":
            continue
         tizu[i][j] == "#" tizu[i][j] [i] tizu i j "#" continue pos = [i] pos [i] i cnt = 0 cnt 0 for k in range(i + 1, h):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
         k range(i + 1, h) range i + 1 i 1 h if tizu[k][j] == "#":
                break
             tizu[k][j] == "#" tizu[k][j] [k] tizu k j "#" break pos.append(k) pos.append pos append k cnt += 1 cnt 1 for k in range(i - 1, -1, -1):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
         k range(i - 1, -1, -1) range i - 1 i 1 -1 -1 if tizu[k][j] == "#":
                break
             tizu[k][j] == "#" tizu[k][j] [k] tizu k j "#" break pos.append(k) pos.append pos append k cnt += 1 cnt 1 for l in pos:
            ans[l][j] += cnt
            check[l][j] = True l pos ans[l][j] += cnt ans[l][j] [l] ans l j cnt check[l][j] = True check[l][j] [l] check l j True [False for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [False for _ in range(w)] check = [[False for _ in range(w)] for _ in range(h)] check [[False for _ in range(w)] for _ in range(h)] max_ans = 0 max_ans 0 for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [j]
        cnt = 0
        for k in range(j + 1, w):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(j - 1, -1, -1):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[i][l] += cnt
            check[i][l] = True
            max_ans = max(max_ans, ans[i][l]) i range(h) range h for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [j]
        cnt = 0
        for k in range(j + 1, w):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(j - 1, -1, -1):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[i][l] += cnt
            check[i][l] = True
            max_ans = max(max_ans, ans[i][l]) j range(w) range w if check[i][j]:
            continue
         check[i][j] [i] check i j continue if tizu[i][j] == "#":
            continue
         tizu[i][j] == "#" tizu[i][j] [i] tizu i j "#" continue pos = [j] pos [j] j cnt = 0 cnt 0 for k in range(j + 1, w):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
         k range(j + 1, w) range j + 1 j 1 w if tizu[i][k] == "#":
                break
             tizu[i][k] == "#" tizu[i][k] [i] tizu i k "#" break pos.append(k) pos.append pos append k cnt += 1 cnt 1 for k in range(j - 1, -1, -1):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
         k range(j - 1, -1, -1) range j - 1 j 1 -1 -1 if tizu[i][k] == "#":
                break
             tizu[i][k] == "#" tizu[i][k] [i] tizu i k "#" break pos.append(k) pos.append pos append k cnt += 1 cnt 1 for l in pos:
            ans[i][l] += cnt
            check[i][l] = True
            max_ans = max(max_ans, ans[i][l]) l pos ans[i][l] += cnt ans[i][l] [i] ans i l cnt check[i][l] = True check[i][l] [i] check i l True max_ans = max(max_ans, ans[i][l]) max_ans max(max_ans, ans[i][l]) max max_ans ans[i][l] [i] ans i l print(max_ans) print max_ans cnt += 1 1 cnt cnt += 1 1 cnt cnt += 1 1 cnt check = [[False for _ in range(w)] for _ in range(h)] [[False for _ in range(w)] for _ in range(h)] check ans = [[1 for _ in range(w)] for _ in range(h)] [[1 for _ in range(w)] for _ in range(h)] ans max_ans = 0 0 max_ans h, w = map(int, input().split()) map(int, input().split()) h check = [[False for _ in range(w)] for _ in range(h)] [[False for _ in range(w)] for _ in range(h)] check pos = [j] [j] pos cnt = 0 0 cnt cnt = 0 0 cnt w = map(int, input().split()) map(int, input().split()) w cnt += 1 1 cnt pos = [i] [i] pos max_ans = max(max_ans, ans[i][l]) max(max_ans, ans[i][l]) max_ans tizu = [input() for _ in range(h)] [input() for _ in range(h)] tizu
h, w = map(int, input().split())
tizu = [input() for _ in range(h)]
check = [[False for _ in range(w)] for _ in range(h)]
ans = [[1 for _ in range(w)] for _ in range(h)]

for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [i]
        cnt = 0
        for k in range(i + 1, h):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(i - 1, -1, -1):
            if tizu[k][j] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[l][j] += cnt
            check[l][j] = True

check = [[False for _ in range(w)] for _ in range(h)]
max_ans = 0
for i in range(h):
    for j in range(w):
        if check[i][j]:
            continue
        if tizu[i][j] == "#":
            continue
        pos = [j]
        cnt = 0
        for k in range(j + 1, w):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for k in range(j - 1, -1, -1):
            if tizu[i][k] == "#":
                break
            pos.append(k)
            cnt += 1
        for l in pos:
            ans[i][l] += cnt
            check[i][l] = True
            max_ans = max(max_ans, ans[i][l])
print(max_ans)