h, w = map(int, input().split())
w += 2
h += 2
grid = ["#" * w]

dpx = [[0] * w for _ in range(h)]
dpy = [[0] * w for _ in range(h)]
for y in range(1, h - 1):
    grid.append("#" + input() + "#")
    for x in range(1, w):
        if grid[y][x] == '.':
            dpx[y][x] = dpx[y][x - 1] + 1
            dpy[y][x] = dpy[y - 1][x] + 1
    for x in range(w - 2, 0, -1):
        if dpx[y][x] != 0 and dpx[y][x + 1] != 0:
            dpx[y][x] = dpx[y][x + 1]

max_val = 0
for y in range(h - 2, 0, -1):
    for x in range(1, w - 1):
        if dpy[y][x] != 0 and dpy[y + 1][x] != 0:
            dpy[y][x] = dpy[y + 1][x]
        val = dpy[y][x] + dpx[y][x] - 1
        if max_val < val:
            max_val = val
print(max_val) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w w += 2 w 2 h += 2 h 2 grid = ["#" * w] grid ["#" * w] "#" * w "#" w [0] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * w [0] 0 w dpx = [[0] * w for _ in range(h)] dpx [[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 dpy = [[0] * w for _ in range(h)] dpy [[0] * w for _ in range(h)] for y in range(1, h - 1):
    grid.append("#" + input() + "#")
    for x in range(1, w):
        if grid[y][x] == '.':
            dpx[y][x] = dpx[y][x - 1] + 1
            dpy[y][x] = dpy[y - 1][x] + 1
    for x in range(w - 2, 0, -1):
        if dpx[y][x] != 0 and dpx[y][x + 1] != 0:
            dpx[y][x] = dpx[y][x + 1] y range(1, h - 1) range 1 h - 1 h 1 grid.append("#" + input() + "#") grid.append grid append "#" + input() + "#" "#" + input() "#" input() input "#" for x in range(1, w):
        if grid[y][x] == '.':
            dpx[y][x] = dpx[y][x - 1] + 1
            dpy[y][x] = dpy[y - 1][x] + 1
     x range(1, w) range 1 w if grid[y][x] == '.':
            dpx[y][x] = dpx[y][x - 1] + 1
            dpy[y][x] = dpy[y - 1][x] + 1
     grid[y][x] == '.' grid[y][x] [y] grid y x '.' dpx[y][x] = dpx[y][x - 1] + 1 dpx[y][x] [y] dpx y x dpx[y][x - 1] + 1 dpx[y][x - 1] [y] dpx y x - 1 x 1 1 dpy[y][x] = dpy[y - 1][x] + 1 dpy[y][x] [y] dpy y x dpy[y - 1][x] + 1 dpy[y - 1][x] [y - 1] dpy y - 1 y 1 x 1 for x in range(w - 2, 0, -1):
        if dpx[y][x] != 0 and dpx[y][x + 1] != 0:
            dpx[y][x] = dpx[y][x + 1] x range(w - 2, 0, -1) range w - 2 w 2 0 -1 if dpx[y][x] != 0 and dpx[y][x + 1] != 0:
            dpx[y][x] = dpx[y][x + 1] dpx[y][x] != 0 and dpx[y][x + 1] != 0 dpx[y][x] != 0 dpx[y][x] [y] dpx y x 0 dpx[y][x + 1] != 0 dpx[y][x + 1] [y] dpx y x + 1 x 1 0 dpx[y][x] = dpx[y][x + 1] dpx[y][x] [y] dpx y x dpx[y][x + 1] [y] dpx y x + 1 x 1 max_val = 0 max_val 0 for y in range(h - 2, 0, -1):
    for x in range(1, w - 1):
        if dpy[y][x] != 0 and dpy[y + 1][x] != 0:
            dpy[y][x] = dpy[y + 1][x]
        val = dpy[y][x] + dpx[y][x] - 1
        if max_val < val:
            max_val = val y range(h - 2, 0, -1) range h - 2 h 2 0 -1 for x in range(1, w - 1):
        if dpy[y][x] != 0 and dpy[y + 1][x] != 0:
            dpy[y][x] = dpy[y + 1][x]
        val = dpy[y][x] + dpx[y][x] - 1
        if max_val < val:
            max_val = val x range(1, w - 1) range 1 w - 1 w 1 if dpy[y][x] != 0 and dpy[y + 1][x] != 0:
            dpy[y][x] = dpy[y + 1][x]
         dpy[y][x] != 0 and dpy[y + 1][x] != 0 dpy[y][x] != 0 dpy[y][x] [y] dpy y x 0 dpy[y + 1][x] != 0 dpy[y + 1][x] [y + 1] dpy y + 1 y 1 x 0 dpy[y][x] = dpy[y + 1][x] dpy[y][x] [y] dpy y x dpy[y + 1][x] [y + 1] dpy y + 1 y 1 x val = dpy[y][x] + dpx[y][x] - 1 val dpy[y][x] + dpx[y][x] - 1 dpy[y][x] + dpx[y][x] dpy[y][x] [y] dpy y x dpx[y][x] [y] dpx y x 1 if max_val < val:
            max_val = val max_val < val max_val val max_val = val max_val val print(max_val) print max_val w += 2 2 w val = dpy[y][x] + dpx[y][x] - 1 dpy[y][x] + dpx[y][x] - 1 val dpy = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] dpy w = map(int, input().split()) map(int, input().split()) w dpx = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] dpx max_val = 0 0 max_val max_val = val val max_val h += 2 2 h h, w = map(int, input().split()) map(int, input().split()) h grid = ["#" * w] ["#" * w] grid
h, w = map(int, input().split())
w += 2
h += 2
grid = ["#" * w]

dpx = [[0] * w for _ in range(h)]
dpy = [[0] * w for _ in range(h)]
for y in range(1, h - 1):
    grid.append("#" + input() + "#")
    for x in range(1, w):
        if grid[y][x] == '.':
            dpx[y][x] = dpx[y][x - 1] + 1
            dpy[y][x] = dpy[y - 1][x] + 1
    for x in range(w - 2, 0, -1):
        if dpx[y][x] != 0 and dpx[y][x + 1] != 0:
            dpx[y][x] = dpx[y][x + 1]

max_val = 0
for y in range(h - 2, 0, -1):
    for x in range(1, w - 1):
        if dpy[y][x] != 0 and dpy[y + 1][x] != 0:
            dpy[y][x] = dpy[y + 1][x]
        val = dpy[y][x] + dpx[y][x] - 1
        if max_val < val:
            max_val = val
print(max_val)