h, w = list(map(int, input().split()))
s = []
up, down, right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)]
for _ in range(h):
    s.append(list(input()))

for j in range(w):
    for i in range(h - 1, -1, -1):
        if s[i][j] == ".":
            if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1

for j in range(w):
    for i in range(h):
        if s[i][j] == ".":
            if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1

for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == ".":
            if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1

for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1

res = 0
for i in range(h):
    for j in range(w):
        lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3
        res = max(res, lit)
print(res) h, w = list(map(int, input().split())) h list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split w s = [] s [] [[0 for _ in range(w)] for _ in range(h)] for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) [[0 for _ in range(w)] for _ in range(h)] up, down, right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] up [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] down right left for _ in range(h):
    s.append(list(input())) _ range(h) range h s.append(list(input())) s.append s append list(input()) list input() input for j in range(w):
    for i in range(h - 1, -1, -1):
        if s[i][j] == ".":
            if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1 j range(w) range w for i in range(h - 1, -1, -1):
        if s[i][j] == ".":
            if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1 i range(h - 1, -1, -1) range h - 1 h 1 -1 -1 if s[i][j] == ".":
            if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1 s[i][j] == "." s[i][j] [i] s i j "." if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1 i == h - 1 i h - 1 h 1 down[i][j] = 1 down[i][j] [i] down i j 1 down[i][j] = down[i + 1][j] + 1 down[i][j] [i] down i j down[i + 1][j] + 1 down[i + 1][j] [i + 1] down i + 1 i 1 j 1 for j in range(w):
    for i in range(h):
        if s[i][j] == ".":
            if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1 j range(w) range w for i in range(h):
        if s[i][j] == ".":
            if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1 i range(h) range h if s[i][j] == ".":
            if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1 s[i][j] == "." s[i][j] [i] s i j "." if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1 i == 0 i 0 up[i][j] = 1 up[i][j] [i] up i j 1 up[i][j] = up[i - 1][j] + 1 up[i][j] [i] up i j up[i - 1][j] + 1 up[i - 1][j] [i - 1] up i - 1 i 1 j 1 for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == ".":
            if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1 i range(h) range h for j in range(w - 1, -1, -1):
        if s[i][j] == ".":
            if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1 j range(w - 1, -1, -1) range w - 1 w 1 -1 -1 if s[i][j] == ".":
            if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1 s[i][j] == "." s[i][j] [i] s i j "." if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1 j == w - 1 j w - 1 w 1 right[i][j] = 1 right[i][j] [i] right i j 1 right[i][j] = right[i][j + 1] + 1 right[i][j] [i] right i j right[i][j + 1] + 1 right[i][j + 1] [i] right i j + 1 j 1 1 for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1 i range(h) range h for j in range(w):
        if s[i][j] == ".":
            if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1 j range(w) range w if s[i][j] == ".":
            if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1 s[i][j] == "." s[i][j] [i] s i j "." if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1 j == 0 j 0 left[i][j] = 1 left[i][j] [i] left i j 1 left[i][j] = left[i][j - 1] + 1 left[i][j] [i] left i j left[i][j - 1] + 1 left[i][j - 1] [i] left i j - 1 j 1 1 res = 0 res 0 for i in range(h):
    for j in range(w):
        lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3
        res = max(res, lit) i range(h) range h for j in range(w):
        lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3
        res = max(res, lit) j range(w) range w lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3 lit up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3 up[i][j] + down[i][j] + right[i][j] + left[i][j] up[i][j] + down[i][j] + right[i][j] up[i][j] + down[i][j] up[i][j] [i] up i j down[i][j] [i] down i j right[i][j] [i] right i j left[i][j] [i] left i j 3 res = max(res, lit) res max(res, lit) max res lit print(res) print res res = 0 0 res down, right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] down s = [] [] s w = list(map(int, input().split())) list(map(int, input().split())) w lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3 up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3 lit h, w = list(map(int, input().split())) list(map(int, input().split())) h left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] left res = max(res, lit) max(res, lit) res right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] right up, down, right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)] up
h, w = list(map(int, input().split()))
s = []
up, down, right, left = [
    [[0 for _ in range(w)] for _ in range(h)] for _ in range(4)]
for _ in range(h):
    s.append(list(input()))

for j in range(w):
    for i in range(h - 1, -1, -1):
        if s[i][j] == ".":
            if i == h - 1:
                down[i][j] = 1
            else:
                down[i][j] = down[i + 1][j] + 1

for j in range(w):
    for i in range(h):
        if s[i][j] == ".":
            if i == 0:
                up[i][j] = 1
            else:
                up[i][j] = up[i - 1][j] + 1

for i in range(h):
    for j in range(w - 1, -1, -1):
        if s[i][j] == ".":
            if j == w - 1:
                right[i][j] = 1
            else:
                right[i][j] = right[i][j + 1] + 1

for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j == 0:
                left[i][j] = 1
            else:
                left[i][j] = left[i][j - 1] + 1

res = 0
for i in range(h):
    for j in range(w):
        lit = up[i][j] + down[i][j] + right[i][j] + left[i][j] - 3
        res = max(res, lit)
print(res)
