H,W = map(int, input().split())
fs = []
for i in range(H):
    fs.append(input())

lefts = [[0]*W for i in range(H)]
rights = [[0]*W for i in range(H)]
for i in range(H):
    for j in range(W):
        if fs[i][j] == "#":
            lefts[i][j] = 0
        if fs[i][j] == ".":
            if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
        jr = W - j - 1
        if fs[i][jr] == "#":
            rights[i][jr] = 0
        else:
            if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1
ups = [[0]*W for i in range(H)]
downs = [[0]*W for i in range(H)]
for j in range(W):
    for i in range(H):
        if fs[i][j] == "#":
            ups[i][j] = 0
        else:
            if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
        ir = H - i - 1
        if fs[ir][j] == "#":
            downs[ir][j] = 0
        else:
            if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r)

ans = 0
for i in range(H):
    for j in range(W):
        x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j]
        # print(i,j,lefts[i][j] ,rights[i][j] ,ups[i][j] ,downs[i][j])
        ans = max(x,ans)
print(ans-3) H,W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W fs = [] fs [] for i in range(H):
    fs.append(input()) i range(H) range H fs.append(input()) fs.append fs append input() input [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W lefts = [[0]*W for i in range(H)] lefts [[0]*W for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W rights = [[0]*W for i in range(H)] rights [[0]*W for i in range(H)] for i in range(H):
    for j in range(W):
        if fs[i][j] == "#":
            lefts[i][j] = 0
        if fs[i][j] == ".":
            if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
        jr = W - j - 1
        if fs[i][jr] == "#":
            rights[i][jr] = 0
        else:
            if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1 i range(H) range H for j in range(W):
        if fs[i][j] == "#":
            lefts[i][j] = 0
        if fs[i][j] == ".":
            if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
        jr = W - j - 1
        if fs[i][jr] == "#":
            rights[i][jr] = 0
        else:
            if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1 j range(W) range W if fs[i][j] == "#":
            lefts[i][j] = 0
         fs[i][j] == "#" fs[i][j] [i] fs i j "#" lefts[i][j] = 0 lefts[i][j] [i] lefts i j 0 if fs[i][j] == ".":
            if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
         fs[i][j] == "." fs[i][j] [i] fs i j "." if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
         j == 0 j 0 lefts[i][j] = 1 lefts[i][j] [i] lefts i j 1 lefts[i][j] = lefts[i][j-1] + 1 lefts[i][j] [i] lefts i j lefts[i][j-1] + 1 lefts[i][j-1] [i] lefts i j-1 j 1 1 jr = W - j - 1 jr W - j - 1 W - j W j 1 if fs[i][jr] == "#":
            rights[i][jr] = 0
        else:
            if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1 fs[i][jr] == "#" fs[i][jr] [i] fs i jr "#" rights[i][jr] = 0 rights[i][jr] [i] rights i jr 0 if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1 jr == W-1 jr W-1 W 1 rights[i][jr] = 1 rights[i][jr] [i] rights i jr 1 rights[i][jr] = rights[i][jr+1] + 1 rights[i][jr] [i] rights i jr rights[i][jr+1] + 1 rights[i][jr+1] [i] rights i jr+1 jr 1 1 [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W ups = [[0]*W for i in range(H)] ups [[0]*W for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W downs = [[0]*W for i in range(H)] downs [[0]*W for i in range(H)] for j in range(W):
    for i in range(H):
        if fs[i][j] == "#":
            ups[i][j] = 0
        else:
            if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
        ir = H - i - 1
        if fs[ir][j] == "#":
            downs[ir][j] = 0
        else:
            if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r) j range(W) range W for i in range(H):
        if fs[i][j] == "#":
            ups[i][j] = 0
        else:
            if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
        ir = H - i - 1
        if fs[ir][j] == "#":
            downs[ir][j] = 0
        else:
            if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r) i range(H) range H if fs[i][j] == "#":
            ups[i][j] = 0
        else:
            if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
         fs[i][j] == "#" fs[i][j] [i] fs i j "#" ups[i][j] = 0 ups[i][j] [i] ups i j 0 if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
         i == 0 i 0 ups[i][j] = 1 ups[i][j] [i] ups i j 1 ups[i][j] = ups[i-1][j] + 1 ups[i][j] [i] ups i j ups[i-1][j] + 1 ups[i-1][j] [i-1] ups i-1 i 1 j 1 ir = H - i - 1 ir H - i - 1 H - i H i 1 if fs[ir][j] == "#":
            downs[ir][j] = 0
        else:
            if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r) fs[ir][j] == "#" fs[ir][j] [ir] fs ir j "#" downs[ir][j] = 0 downs[ir][j] [ir] downs ir j 0 if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r) ir == H-1 ir H-1 H 1 downs[ir][j] = 1 downs[ir][j] [ir] downs ir j 1 downs[ir][j] = downs[ir+1][j] + 1 downs[ir][j] [ir] downs ir j downs[ir+1][j] + 1 downs[ir+1][j] [ir+1] downs ir+1 ir 1 j 1 ans = 0 ans 0 for i in range(H):
    for j in range(W):
        x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j]
        # print(i,j,lefts[i][j] ,rights[i][j] ,ups[i][j] ,downs[i][j])
        ans = max(x,ans) i range(H) range H for j in range(W):
        x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j]
        # print(i,j,lefts[i][j] ,rights[i][j] ,ups[i][j] ,downs[i][j])
        ans = max(x,ans) j range(W) range W x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j] x lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j] lefts[i][j] + rights[i][j] + ups[i][j] lefts[i][j] + rights[i][j] lefts[i][j] [i] lefts i j rights[i][j] [i] rights i j ups[i][j] [i] ups i j downs[i][j] [i] downs i j ans = max(x,ans) ans max(x,ans) max x ans print(ans-3) print ans-3 ans 3 ir = H - i - 1 H - i - 1 ir downs = [[0]*W for i in range(H)] [[0]*W for i in range(H)] downs fs = [] [] fs ups = [[0]*W for i in range(H)] [[0]*W for i in range(H)] ups ans = max(x,ans) max(x,ans) ans rights = [[0]*W for i in range(H)] [[0]*W for i in range(H)] rights W = map(int, input().split()) map(int, input().split()) W H,W = map(int, input().split()) map(int, input().split()) H jr = W - j - 1 W - j - 1 jr x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j] lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j] x ans = 0 0 ans lefts = [[0]*W for i in range(H)] [[0]*W for i in range(H)] lefts
H,W = map(int, input().split())
fs = []
for i in range(H):
    fs.append(input())

lefts = [[0]*W for i in range(H)]
rights = [[0]*W for i in range(H)]
for i in range(H):
    for j in range(W):
        if fs[i][j] == "#":
            lefts[i][j] = 0
        if fs[i][j] == ".":
            if j == 0:
                lefts[i][j] = 1
            else:
                lefts[i][j] = lefts[i][j-1] + 1
        jr = W - j - 1
        if fs[i][jr] == "#":
            rights[i][jr] = 0
        else:
            if jr == W-1:
                rights[i][jr] = 1
            else:
                rights[i][jr] = rights[i][jr+1] + 1
ups = [[0]*W for i in range(H)]
downs = [[0]*W for i in range(H)]
for j in range(W):
    for i in range(H):
        if fs[i][j] == "#":
            ups[i][j] = 0
        else:
            if i == 0:
                ups[i][j] = 1
            else:
                ups[i][j] = ups[i-1][j] + 1
        ir = H - i - 1
        if fs[ir][j] == "#":
            downs[ir][j] = 0
        else:
            if ir == H-1:
                downs[ir][j] = 1
            else:
                downs[ir][j] = downs[ir+1][j] + 1


# for l in lefts:
#     print(*l)
# print("-----------")
# for r in rights:
#     print(*r)
# print("updown")
# for l in ups:
#     print(*l)
# print("-----------")
# for r in downs:
#     print(*r)

ans = 0
for i in range(H):
    for j in range(W):
        x = lefts[i][j] + rights[i][j] + ups[i][j] + downs[i][j]
        # print(i,j,lefts[i][j] ,rights[i][j] ,ups[i][j] ,downs[i][j])
        ans = max(x,ans)
print(ans-3)