H, W = map(int, input().split())

G = []
for _ in range(H):
    g = []
    line = input()
    for i in range(W):
        g.append(line[i])
    G.append(g)

# 左に何マス行けるか
G_left = [[0] * W for _ in range(H)]
for h in range(H):
    cnt = 0
    for w in range(W):
        if G[h][w] == "#":
            cnt = 0
            G_left[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか
G_right = [[0] * W for _ in range(H)]
for h in range(H):
    cnt = 0
    for w in range(W - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_right[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか
G_up = [[0] * W for _ in range(H)]
for w in range(W):
    cnt = 0
    for h in range(H):
        if G[h][w] == "#":
            cnt = 0
            G_up[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか
G_down = [[0] * W for _ in range(H)]
for w in range(W):
    cnt = 0
    for h in range(H - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_down[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down)
ans = 0
for h in range(H):
    for w in range(W):
        tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3
        ans = max(ans, tmp)

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W G = [] G [] for _ in range(H):
    g = []
    line = input()
    for i in range(W):
        g.append(line[i])
    G.append(g)

# 左に何マス行けるか _ range(H) range H g = [] g [] line = input() line input() input for i in range(W):
        g.append(line[i])
     i range(W) range W g.append(line[i]) g.append g append line[i] line i G.append(g) G.append G append g [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W G_left = [[0] * W for _ in range(H)] G_left [[0] * W for _ in range(H)] for h in range(H):
    cnt = 0
    for w in range(W):
        if G[h][w] == "#":
            cnt = 0
            G_left[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか h range(H) range H cnt = 0 cnt 0 for w in range(W):
        if G[h][w] == "#":
            cnt = 0
            G_left[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか w range(W) range W if G[h][w] == "#":
            cnt = 0
            G_left[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか G[h][w] == "#" G[h][w] [h] G h w "#" cnt = 0 cnt 0 G_left[h][w] = 0 G_left[h][w] [h] G_left h w 0 elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか G[h][w] == "." G[h][w] [h] G h w "." cnt += 1 cnt 1 G_left[h][w] = cnt G_left[h][w] [h] G_left h w cnt [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W G_right = [[0] * W for _ in range(H)] G_right [[0] * W for _ in range(H)] for h in range(H):
    cnt = 0
    for w in range(W - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_right[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか h range(H) range H cnt = 0 cnt 0 for w in range(W - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_right[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか w range(W - 1, -1, -1) range W - 1 W 1 -1 -1 if G[h][w] == "#":
            cnt = 0
            G_right[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか G[h][w] == "#" G[h][w] [h] G h w "#" cnt = 0 cnt 0 G_right[h][w] = 0 G_right[h][w] [h] G_right h w 0 elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか G[h][w] == "." G[h][w] [h] G h w "." cnt += 1 cnt 1 G_right[h][w] = cnt G_right[h][w] [h] G_right h w cnt [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W G_up = [[0] * W for _ in range(H)] G_up [[0] * W for _ in range(H)] for w in range(W):
    cnt = 0
    for h in range(H):
        if G[h][w] == "#":
            cnt = 0
            G_up[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか w range(W) range W cnt = 0 cnt 0 for h in range(H):
        if G[h][w] == "#":
            cnt = 0
            G_up[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか h range(H) range H if G[h][w] == "#":
            cnt = 0
            G_up[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか G[h][w] == "#" G[h][w] [h] G h w "#" cnt = 0 cnt 0 G_up[h][w] = 0 G_up[h][w] [h] G_up h w 0 elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか G[h][w] == "." G[h][w] [h] G h w "." cnt += 1 cnt 1 G_up[h][w] = cnt G_up[h][w] [h] G_up h w cnt [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W G_down = [[0] * W for _ in range(H)] G_down [[0] * W for _ in range(H)] for w in range(W):
    cnt = 0
    for h in range(H - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_down[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down) w range(W) range W cnt = 0 cnt 0 for h in range(H - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_down[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down) h range(H - 1, -1, -1) range H - 1 H 1 -1 -1 if G[h][w] == "#":
            cnt = 0
            G_down[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down) G[h][w] == "#" G[h][w] [h] G h w "#" cnt = 0 cnt 0 G_down[h][w] = 0 G_down[h][w] [h] G_down h w 0 elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down) G[h][w] == "." G[h][w] [h] G h w "." cnt += 1 cnt 1 G_down[h][w] = cnt G_down[h][w] [h] G_down h w cnt ans = 0 ans 0 for h in range(H):
    for w in range(W):
        tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3
        ans = max(ans, tmp) h range(H) range H for w in range(W):
        tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3
        ans = max(ans, tmp) w range(W) range W tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3 tmp G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3 G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] G_left[h][w] + G_right[h][w] + G_up[h][w] G_left[h][w] + G_right[h][w] G_left[h][w] [h] G_left h w G_right[h][w] [h] G_right h w G_up[h][w] [h] G_up h w G_down[h][w] [h] G_down h w 3 ans = max(ans, tmp) ans max(ans, tmp) max ans tmp print(ans) print ans cnt = 0 0 cnt H, W = map(int, input().split()) map(int, input().split()) H ans = 0 0 ans cnt += 1 1 cnt G_left = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] G_left cnt = 0 0 cnt ans = max(ans, tmp) max(ans, tmp) ans cnt = 0 0 cnt G_up = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] G_up cnt = 0 0 cnt tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3 G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3 tmp G = [] [] G G_right = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] G_right cnt += 1 1 cnt line = input() input() line cnt = 0 0 cnt cnt += 1 1 cnt g = [] [] g cnt = 0 0 cnt G_down = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] G_down cnt = 0 0 cnt W = map(int, input().split()) map(int, input().split()) W cnt = 0 0 cnt cnt += 1 1 cnt
H, W = map(int, input().split())

G = []
for _ in range(H):
    g = []
    line = input()
    for i in range(W):
        g.append(line[i])
    G.append(g)

# 左に何マス行けるか
G_left = [[0] * W for _ in range(H)]
for h in range(H):
    cnt = 0
    for w in range(W):
        if G[h][w] == "#":
            cnt = 0
            G_left[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_left[h][w] = cnt
# print(G_left)

# 右に何マス行けるか
G_right = [[0] * W for _ in range(H)]
for h in range(H):
    cnt = 0
    for w in range(W - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_right[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_right[h][w] = cnt
# print(G_right)

# 上に何マス行けるか
G_up = [[0] * W for _ in range(H)]
for w in range(W):
    cnt = 0
    for h in range(H):
        if G[h][w] == "#":
            cnt = 0
            G_up[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_up[h][w] = cnt
# print(G_up)

# 下に何マス行けるか
G_down = [[0] * W for _ in range(H)]
for w in range(W):
    cnt = 0
    for h in range(H - 1, -1, -1):
        if G[h][w] == "#":
            cnt = 0
            G_down[h][w] = 0
        elif G[h][w] == ".":
            cnt += 1
            G_down[h][w] = cnt
# print(G_down)
ans = 0
for h in range(H):
    for w in range(W):
        tmp = G_left[h][w] + G_right[h][w] + G_up[h][w] + G_down[h][w] - 3
        ans = max(ans, tmp)

print(ans)
