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

grid = []
for _ in range(H):
    line = input()
    # 後で都合が良いので末尾に足しておく
    line += "#"
    grid.append(line)

# 後で都合が良いので末尾に足しておく
grid.append("#" * W)
# print(grid)

G_h = []
for h in range(H):
    g = [-1] * W
    lamp_start = -1
    lamp = 0
    line = grid[h]
    for w in range(W):
        if line[w] == "#":
            g[w] = 0
        elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_h.append(g)

# print(G_h)

G_v = []
for w in range(W):
    g = [-1] * H
    lamp_start = -1
    lamp = 0
    line = []
    for hi in range(H):
        line.append(grid[hi][w])
    line.append("#")
    # line = grid[w]
    for h in range(H):
        if line[h] == "#":
            g[h] = 0
        elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_v.append(g)

# print(G_v)

ans = 0
for h in range(H):
    for w in range(W):
        tmp_ans = G_h[h][w] + G_v[w][h] - 1
        ans = max(ans, tmp_ans)
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):
    line = input()
    # 後で都合が良いので末尾に足しておく
    line += "#"
    grid.append(line)

# 後で都合が良いので末尾に足しておく _ range(H) range H line = input() line input() input line += "#" line "#" grid.append(line) grid.append grid append line grid.append("#" * W) grid.append grid append "#" * W "#" W G_h = [] G_h [] for h in range(H):
    g = [-1] * W
    lamp_start = -1
    lamp = 0
    line = grid[h]
    for w in range(W):
        if line[w] == "#":
            g[w] = 0
        elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_h.append(g)

# print(G_h) h range(H) range H g = [-1] * W g [-1] * W [-1] -1 W lamp_start = -1 lamp_start -1 lamp = 0 lamp 0 line = grid[h] line grid[h] grid h for w in range(W):
        if line[w] == "#":
            g[w] = 0
        elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     w range(W) range W if line[w] == "#":
            g[w] = 0
        elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[w] == "#" line[w] line w "#" g[w] = 0 g[w] g w 0 elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[w] == "." line[w] line w "." lamp += 1 lamp 1 if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
             lamp_start == -1 lamp_start -1 lamp_start = w lamp_start w if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[w + 1] == "#" line[w + 1] line w + 1 w 1 "#" for i in range(lamp_start, w + 1):
                    g[i] = lamp
                 i range(lamp_start, w + 1) range lamp_start w + 1 w 1 g[i] = lamp g[i] g i lamp lamp_start = -1 lamp_start -1 lamp = 0 lamp 0 G_h.append(g) G_h.append G_h append g G_v = [] G_v [] for w in range(W):
    g = [-1] * H
    lamp_start = -1
    lamp = 0
    line = []
    for hi in range(H):
        line.append(grid[hi][w])
    line.append("#")
    # line = grid[w]
    for h in range(H):
        if line[h] == "#":
            g[h] = 0
        elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_v.append(g)

# print(G_v) w range(W) range W g = [-1] * H g [-1] * H [-1] -1 H lamp_start = -1 lamp_start -1 lamp = 0 lamp 0 line = [] line [] for hi in range(H):
        line.append(grid[hi][w])
     hi range(H) range H line.append(grid[hi][w]) line.append line append grid[hi][w] [hi] grid hi w line.append("#") line.append line append "#" for h in range(H):
        if line[h] == "#":
            g[h] = 0
        elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     h range(H) range H if line[h] == "#":
            g[h] = 0
        elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[h] == "#" line[h] line h "#" g[h] = 0 g[h] g h 0 elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[h] == "." line[h] line h "." lamp += 1 lamp 1 if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
             lamp_start == -1 lamp_start -1 lamp_start = h lamp_start h if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
     line[h + 1] == "#" line[h + 1] line h + 1 h 1 "#" for i in range(lamp_start, h + 1):
                    g[i] = lamp
                 i range(lamp_start, h + 1) range lamp_start h + 1 h 1 g[i] = lamp g[i] g i lamp lamp_start = -1 lamp_start -1 lamp = 0 lamp 0 G_v.append(g) G_v.append G_v append g ans = 0 ans 0 for h in range(H):
    for w in range(W):
        tmp_ans = G_h[h][w] + G_v[w][h] - 1
        ans = max(ans, tmp_ans) h range(H) range H for w in range(W):
        tmp_ans = G_h[h][w] + G_v[w][h] - 1
        ans = max(ans, tmp_ans) w range(W) range W tmp_ans = G_h[h][w] + G_v[w][h] - 1 tmp_ans G_h[h][w] + G_v[w][h] - 1 G_h[h][w] + G_v[w][h] G_h[h][w] [h] G_h h w G_v[w][h] [w] G_v w h 1 ans = max(ans, tmp_ans) ans max(ans, tmp_ans) max ans tmp_ans print(ans) print ans lamp = 0 0 lamp lamp_start = -1 -1 lamp_start lamp_start = -1 -1 lamp_start line += "#" "#" line lamp += 1 1 lamp lamp += 1 1 lamp W = map(int, input().split()) map(int, input().split()) W lamp = 0 0 lamp tmp_ans = G_h[h][w] + G_v[w][h] - 1 G_h[h][w] + G_v[w][h] - 1 tmp_ans g = [-1] * W [-1] * W g ans = max(ans, tmp_ans) max(ans, tmp_ans) ans lamp_start = -1 -1 lamp_start lamp = 0 0 lamp H, W = map(int, input().split()) map(int, input().split()) H grid = [] [] grid line = [] [] line line = input() input() line g = [-1] * H [-1] * H g lamp_start = w w lamp_start G_v = [] [] G_v ans = 0 0 ans lamp_start = -1 -1 lamp_start G_h = [] [] G_h lamp_start = h h lamp_start line = grid[h] grid[h] line lamp = 0 0 lamp
H, W = map(int, input().split())

grid = []
for _ in range(H):
    line = input()
    # 後で都合が良いので末尾に足しておく
    line += "#"
    grid.append(line)

# 後で都合が良いので末尾に足しておく
grid.append("#" * W)
# print(grid)

G_h = []
for h in range(H):
    g = [-1] * W
    lamp_start = -1
    lamp = 0
    line = grid[h]
    for w in range(W):
        if line[w] == "#":
            g[w] = 0
        elif line[w] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = w
                # print("lampstart", w)
            if line[w + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, w + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_h.append(g)

# print(G_h)

G_v = []
for w in range(W):
    g = [-1] * H
    lamp_start = -1
    lamp = 0
    line = []
    for hi in range(H):
        line.append(grid[hi][w])
    line.append("#")
    # line = grid[w]
    for h in range(H):
        if line[h] == "#":
            g[h] = 0
        elif line[h] == ".":
            lamp += 1
            if lamp_start == -1:
                lamp_start = h
                # print("lampstart", w)
            if line[h + 1] == "#":
                # print("lampend", w)
                for i in range(lamp_start, h + 1):
                    g[i] = lamp
                lamp_start = -1
                lamp = 0
    G_v.append(g)

# print(G_v)

ans = 0
for h in range(H):
    for w in range(W):
        tmp_ans = G_h[h][w] + G_v[w][h] - 1
        ans = max(ans, tmp_ans)
print(ans)
