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

G = []
for _ in range(H):
    G.append(list(input()))

L, R, U, B = [], [], [], []
for y in range(H):
    targets = [L, R]
    ranges = [range(W), range(W-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        row = [0] * W
        c = -1
        for x in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            row[x] = c
        target.append(row)
for x in range(W):
    targets = [U, B]
    ranges = [range(H), range(H-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        col = [0] * H
        c = -1
        for y in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            col[y] = c
        target.append(col)

max_light = 0
for y in range(H):
    for x in range(W):
        light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1
        max_light = max(light, max_light)
print(max_light) 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.append(list(input())) _ range(H) range H G.append(list(input())) G.append G append list(input()) list input() input L, R, U, B = [], [], [], [] L [] R [] U [] B [] for y in range(H):
    targets = [L, R]
    ranges = [range(W), range(W-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        row = [0] * W
        c = -1
        for x in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            row[x] = c
        target.append(row) y range(H) range H targets = [L, R] targets [L, R] L R ranges = [range(W), range(W-1, -1, -1)] ranges [range(W), range(W-1, -1, -1)] range(W) range W range(W-1, -1, -1) range W-1 W 1 -1 -1 for target, rng in zip(targets, ranges):
        row = [0] * W
        c = -1
        for x in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            row[x] = c
        target.append(row) target rng zip(targets, ranges) zip targets ranges row = [0] * W row [0] * W [0] 0 W c = -1 c -1 for x in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            row[x] = c
         x rng if G[y][x] == "#":
                c = -1
            else:
                c += 1
             G[y][x] == "#" G[y][x] [y] G y x "#" c = -1 c -1 c += 1 c 1 row[x] = c row[x] row x c target.append(row) target.append target append row for x in range(W):
    targets = [U, B]
    ranges = [range(H), range(H-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        col = [0] * H
        c = -1
        for y in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            col[y] = c
        target.append(col) x range(W) range W targets = [U, B] targets [U, B] U B ranges = [range(H), range(H-1, -1, -1)] ranges [range(H), range(H-1, -1, -1)] range(H) range H range(H-1, -1, -1) range H-1 H 1 -1 -1 for target, rng in zip(targets, ranges):
        col = [0] * H
        c = -1
        for y in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            col[y] = c
        target.append(col) target rng zip(targets, ranges) zip targets ranges col = [0] * H col [0] * H [0] 0 H c = -1 c -1 for y in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            col[y] = c
         y rng if G[y][x] == "#":
                c = -1
            else:
                c += 1
             G[y][x] == "#" G[y][x] [y] G y x "#" c = -1 c -1 c += 1 c 1 col[y] = c col[y] col y c target.append(col) target.append target append col max_light = 0 max_light 0 for y in range(H):
    for x in range(W):
        light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1
        max_light = max(light, max_light) y range(H) range H for x in range(W):
        light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1
        max_light = max(light, max_light) x range(W) range W light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1 light L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1 L[y][x] + R[y][x] + U[x][y] + B[x][y] L[y][x] + R[y][x] + U[x][y] L[y][x] + R[y][x] L[y][x] [y] L y x R[y][x] [y] R y x U[x][y] [x] U x y B[x][y] [x] B x y 1 max_light = max(light, max_light) max_light max(light, max_light) max light max_light print(max_light) print max_light U, B = [], [], [], [] [] U row = [0] * W [0] * W row col = [0] * H [0] * H col c = -1 -1 c R, U, B = [], [], [], [] [] R L, R, U, B = [], [], [], [] [] L B = [], [], [], [] [] B ranges = [range(H), range(H-1, -1, -1)] [range(H), range(H-1, -1, -1)] ranges c += 1 1 c max_light = max(light, max_light) max(light, max_light) max_light max_light = 0 0 max_light G = [] [] G c = -1 -1 c ranges = [range(W), range(W-1, -1, -1)] [range(W), range(W-1, -1, -1)] ranges c = -1 -1 c targets = [L, R] [L, R] targets c += 1 1 c W = map(int, input().split()) map(int, input().split()) W targets = [U, B] [U, B] targets light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1 L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1 light H, W = map(int, input().split()) map(int, input().split()) H c = -1 -1 c
H, W = map(int, input().split())

G = []
for _ in range(H):
    G.append(list(input()))

L, R, U, B = [], [], [], []
for y in range(H):
    targets = [L, R]
    ranges = [range(W), range(W-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        row = [0] * W
        c = -1
        for x in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            row[x] = c
        target.append(row)
for x in range(W):
    targets = [U, B]
    ranges = [range(H), range(H-1, -1, -1)]
    for target, rng in zip(targets, ranges):
        col = [0] * H
        c = -1
        for y in rng:
            if G[y][x] == "#":
                c = -1
            else:
                c += 1
            col[y] = c
        target.append(col)

max_light = 0
for y in range(H):
    for x in range(W):
        light = L[y][x] + R[y][x] + U[x][y] + B[x][y] + 1
        max_light = max(light, max_light)
print(max_light)
