H, W = map(int, input().split())
G = [list(input()) for i in range(H)]


up = [[0] * W for i in range(H)]  # あるマスから上に連続していくつ障害物のないマスが続くか
right = [[0] * W for i in range(H)]  # あるマスから右に連続していくつ障害物のないマスが続くか
down = [[0] * W for i in range(H)]  # あるマスから下に連続していくつ障害物のないマスが続くか
left = [[0] * W for i in range(H)]  # あるマスから左に連続していくつ障害物のないマスが続くか


# up
for w in range(W):
    for h in range(1, H):
        if G[h - 1][w] == '#':
            continue
        up[h][w] = up[h - 1][w] + 1

# right
for h in range(H):
    for w in reversed(range(W - 1)):
        if G[h][w + 1] == '#':
            continue
        right[h][w] = right[h][w + 1] + 1

# down
for w in range(W):
    for h in reversed(range(H - 1)):
        if G[h + 1][w] == '#':
            continue
        down[h][w] = down[h + 1][w] + 1

# left
for h in range(H):
    for w in range(1, W):
        if G[h][w - 1] == '#':
            continue
        left[h][w] = left[h][w - 1] + 1


ans = 0
for h in range(H):
    for w in range(W):
        if G[h][w] == '#':
            continue
        ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1)

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W list(input()) for i in range(H) for i in range(H) i range(H) range H for i in range(H) list(input()) list input() input G = [list(input()) for i in range(H)] G [list(input()) 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 up = [[0] * W for i in range(H)] up [[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 right = [[0] * W for i in range(H)] right [[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 down = [[0] * W for i in range(H)] down [[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 left = [[0] * W for i in range(H)] left [[0] * W for i in range(H)] for w in range(W):
    for h in range(1, H):
        if G[h - 1][w] == '#':
            continue
        up[h][w] = up[h - 1][w] + 1

# right w range(W) range W for h in range(1, H):
        if G[h - 1][w] == '#':
            continue
        up[h][w] = up[h - 1][w] + 1

# right h range(1, H) range 1 H if G[h - 1][w] == '#':
            continue
         G[h - 1][w] == '#' G[h - 1][w] [h - 1] G h - 1 h 1 w '#' continue 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 h in range(H):
    for w in reversed(range(W - 1)):
        if G[h][w + 1] == '#':
            continue
        right[h][w] = right[h][w + 1] + 1

# down h range(H) range H for w in reversed(range(W - 1)):
        if G[h][w + 1] == '#':
            continue
        right[h][w] = right[h][w + 1] + 1

# down w reversed(range(W - 1)) reversed range(W - 1) range W - 1 W 1 if G[h][w + 1] == '#':
            continue
         G[h][w + 1] == '#' G[h][w + 1] [h] G h w + 1 w 1 '#' continue 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 reversed(range(H - 1)):
        if G[h + 1][w] == '#':
            continue
        down[h][w] = down[h + 1][w] + 1

# left w range(W) range W for h in reversed(range(H - 1)):
        if G[h + 1][w] == '#':
            continue
        down[h][w] = down[h + 1][w] + 1

# left h reversed(range(H - 1)) reversed range(H - 1) range H - 1 H 1 if G[h + 1][w] == '#':
            continue
         G[h + 1][w] == '#' G[h + 1][w] [h + 1] G h + 1 h 1 w '#' continue 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 for h in range(H):
    for w in range(1, W):
        if G[h][w - 1] == '#':
            continue
        left[h][w] = left[h][w - 1] + 1 h range(H) range H for w in range(1, W):
        if G[h][w - 1] == '#':
            continue
        left[h][w] = left[h][w - 1] + 1 w range(1, W) range 1 W if G[h][w - 1] == '#':
            continue
         G[h][w - 1] == '#' G[h][w - 1] [h] G h w - 1 w 1 '#' continue 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 ans = 0 ans 0 for h in range(H):
    for w in range(W):
        if G[h][w] == '#':
            continue
        ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) h range(H) range H for w in range(W):
        if G[h][w] == '#':
            continue
        ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) w range(W) range W if G[h][w] == '#':
            continue
         G[h][w] == '#' G[h][w] [h] G h w '#' continue ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) ans max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) max ans up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1 up[h][w] + right[h][w] + down[h][w] + left[h][w] up[h][w] + right[h][w] + down[h][w] up[h][w] + right[h][w] up[h][w] [h] up h w right[h][w] [h] right h w down[h][w] [h] down h w left[h][w] [h] left h w 1 print(ans) print ans right = [[0] * W for i in range(H)] [[0] * W for i in range(H)] right ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1) ans left = [[0] * W for i in range(H)] [[0] * W for i in range(H)] left down = [[0] * W for i in range(H)] [[0] * W for i in range(H)] down W = map(int, input().split()) map(int, input().split()) W G = [list(input()) for i in range(H)] [list(input()) for i in range(H)] G H, W = map(int, input().split()) map(int, input().split()) H up = [[0] * W for i in range(H)] [[0] * W for i in range(H)] up ans = 0 0 ans
H, W = map(int, input().split())
G = [list(input()) for i in range(H)]


up = [[0] * W for i in range(H)]  # あるマスから上に連続していくつ障害物のないマスが続くか
right = [[0] * W for i in range(H)]  # あるマスから右に連続していくつ障害物のないマスが続くか
down = [[0] * W for i in range(H)]  # あるマスから下に連続していくつ障害物のないマスが続くか
left = [[0] * W for i in range(H)]  # あるマスから左に連続していくつ障害物のないマスが続くか


# up
for w in range(W):
    for h in range(1, H):
        if G[h - 1][w] == '#':
            continue
        up[h][w] = up[h - 1][w] + 1

# right
for h in range(H):
    for w in reversed(range(W - 1)):
        if G[h][w + 1] == '#':
            continue
        right[h][w] = right[h][w + 1] + 1

# down
for w in range(W):
    for h in reversed(range(H - 1)):
        if G[h + 1][w] == '#':
            continue
        down[h][w] = down[h + 1][w] + 1

# left
for h in range(H):
    for w in range(1, W):
        if G[h][w - 1] == '#':
            continue
        left[h][w] = left[h][w - 1] + 1


ans = 0
for h in range(H):
    for w in range(W):
        if G[h][w] == '#':
            continue
        ans = max(ans, up[h][w] + right[h][w] + down[h][w] + left[h][w] + 1)

print(ans)
