H, W = map(int, input().split())
grid = []
for _ in range(H):
    grid.append([s for s in input()])
    
left = [[0 for _ in range(W)] for _ in range(H)]
right = [[0 for _ in range(W)] for _ in range(H)]
up = [[0 for _ in range(W)] for _ in range(H)]
down = [[0 for _ in range(W)] for _ in range(H)]

for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1

for h in range(H):
    for w in range(W)[::-1]:
        if grid[h][w] == ".":
            if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
            
for w in range(W):
    for h in range(H):
        if grid[h][w] == ".":
            if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                
for w in range(W):
    for h in range(H)[::-1]:
        if grid[h][w] == ".":
            if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                
ans = -10000
for h in range(H):
    for w in range(W):
        ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3)
print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W grid = [] grid [] for _ in range(H):
    grid.append([s for s in input()])
     _ range(H) range H s for s in input() for s in input() s input() input for s in input() s grid.append([s for s in input()]) grid.append grid append [s for s in input()] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] left = [[0 for _ in range(W)] for _ in range(H)] left [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] right = [[0 for _ in range(W)] for _ in range(H)] right [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] up = [[0 for _ in range(W)] for _ in range(H)] up [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] down = [[0 for _ in range(W)] for _ in range(H)] down [[0 for _ in range(W)] for _ in range(H)] for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1 h range(H) range H for w in range(W):
        if grid[h][w] == ".":
            if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1 w range(W) range W if grid[h][w] == ".":
            if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1 grid[h][w] == "." grid[h][w] [h] grid h w "." if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1 w == 0 w 0 left[h][w] = 1 left[h][w] [h] left h w 1 left[h][w] += left[h][w - 1] + 1 left[h][w] [h] left h w left[h][w - 1] + 1 left[h][w - 1] [h] left h w - 1 w 1 1 for h in range(H):
    for w in range(W)[::-1]:
        if grid[h][w] == ".":
            if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
             h range(H) range H for w in range(W)[::-1]:
        if grid[h][w] == ".":
            if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
             w range(W)[::-1] (W) range W ::-1 -1 if grid[h][w] == ".":
            if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
             grid[h][w] == "." grid[h][w] [h] grid h w "." if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
             w == W - 1 w W - 1 W 1 right[h][w] = 1 right[h][w] [h] right h w 1 right[h][w] += right[h][w + 1] + 1 right[h][w] [h] right h w right[h][w + 1] + 1 right[h][w + 1] [h] right h w + 1 w 1 1 for w in range(W):
    for h in range(H):
        if grid[h][w] == ".":
            if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                 w range(W) range W for h in range(H):
        if grid[h][w] == ".":
            if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                 h range(H) range H if grid[h][w] == ".":
            if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                 grid[h][w] == "." grid[h][w] [h] grid h w "." if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                 h == 0 h 0 up[h][w] = 1 up[h][w] [h] up h w 1 up[h][w] += up[h - 1][w] + 1 up[h][w] [h] up h w up[h - 1][w] + 1 up[h - 1][w] [h - 1] up h - 1 h 1 w 1 for w in range(W):
    for h in range(H)[::-1]:
        if grid[h][w] == ".":
            if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                 w range(W) range W for h in range(H)[::-1]:
        if grid[h][w] == ".":
            if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                 h range(H)[::-1] (H) range H ::-1 -1 if grid[h][w] == ".":
            if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                 grid[h][w] == "." grid[h][w] [h] grid h w "." if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                 h == H - 1 h H - 1 H 1 down[h][w] = 1 down[h][w] [h] down h w 1 down[h][w] += down[h + 1][w] + 1 down[h][w] [h] down h w down[h + 1][w] + 1 down[h + 1][w] [h + 1] down h + 1 h 1 w 1 ans = -10000 ans -10000 for h in range(H):
    for w in range(W):
        ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) h range(H) range H for w in range(W):
        ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) w range(W) range W ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) ans max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) max ans up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3 up[h][w] + down[h][w] + right[h][w] + left[h][w] up[h][w] + down[h][w] + right[h][w] up[h][w] + down[h][w] up[h][w] [h] up h w down[h][w] [h] down h w right[h][w] [h] right h w left[h][w] [h] left h w 3 print(ans) print ans up = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] up down = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] down W = map(int, input().split()) map(int, input().split()) W H, W = map(int, input().split()) map(int, input().split()) H grid = [] [] grid left = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] left ans = -10000 -10000 ans ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3) ans right = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] right
H, W = map(int, input().split())
grid = []
for _ in range(H):
    grid.append([s for s in input()])
    
left = [[0 for _ in range(W)] for _ in range(H)]
right = [[0 for _ in range(W)] for _ in range(H)]
up = [[0 for _ in range(W)] for _ in range(H)]
down = [[0 for _ in range(W)] for _ in range(H)]

for h in range(H):
    for w in range(W):
        if grid[h][w] == ".":
            if w == 0:
                left[h][w] = 1
            else:
                left[h][w] += left[h][w - 1] + 1

for h in range(H):
    for w in range(W)[::-1]:
        if grid[h][w] == ".":
            if w == W - 1:
                right[h][w] = 1
            else:
                right[h][w] += right[h][w + 1] + 1
            
for w in range(W):
    for h in range(H):
        if grid[h][w] == ".":
            if h == 0:
                up[h][w] = 1
            else:
                up[h][w] += up[h - 1][w] + 1
                
for w in range(W):
    for h in range(H)[::-1]:
        if grid[h][w] == ".":
            if h == H - 1:
                down[h][w] = 1
            else:
                down[h][w] += down[h + 1][w] + 1
                
ans = -10000
for h in range(H):
    for w in range(W):
        ans = max(ans, up[h][w] + down[h][w] + right[h][w] + left[h][w] - 3)
print(ans)