h, w = list(map(int, raw_input().split()))
grid = [raw_input() for _ in range(h)]

cnt = [[0]*w for _ in range(h)]

yStarts = [-1] * w
yStrks = [0] * w

for y in range(h):
    xStart = -1
    xStrk = 0

    for x in range(w):
        if grid[y][x] == ".":
            if xStart == -1:
                xStart = x
            xStrk += 1

            if yStarts[x] == -1:
                yStarts[x] = y
            yStrks[x] += 1

        if grid[y][x] == "#" or x == w-1:
            if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

            xStart = -1
            xStrk = 0

        if grid[y][x] == "#" or y == h-1:
            if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

            yStarts[x] = -1
            yStrks[x] = 0

ans = 0
for y in range(h):
    for x in range(w):
        ans = max(ans, cnt[y][x]-1)

print(ans) h, w = list(map(int, raw_input().split())) h list(map(int, raw_input().split())) list map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split w raw_input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) raw_input() raw_input grid = [raw_input() for _ in range(h)] grid [raw_input() for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w cnt = [[0]*w for _ in range(h)] cnt [[0]*w for _ in range(h)] yStarts = [-1] * w yStarts [-1] * w [-1] -1 w yStrks = [0] * w yStrks [0] * w [0] 0 w for y in range(h):
    xStart = -1
    xStrk = 0

    for x in range(w):
        if grid[y][x] == ".":
            if xStart == -1:
                xStart = x
            xStrk += 1

            if yStarts[x] == -1:
                yStarts[x] = y
            yStrks[x] += 1

        if grid[y][x] == "#" or x == w-1:
            if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

            xStart = -1
            xStrk = 0

        if grid[y][x] == "#" or y == h-1:
            if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

            yStarts[x] = -1
            yStrks[x] = 0 y range(h) range h xStart = -1 xStart -1 xStrk = 0 xStrk 0 for x in range(w):
        if grid[y][x] == ".":
            if xStart == -1:
                xStart = x
            xStrk += 1

            if yStarts[x] == -1:
                yStarts[x] = y
            yStrks[x] += 1

        if grid[y][x] == "#" or x == w-1:
            if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

            xStart = -1
            xStrk = 0

        if grid[y][x] == "#" or y == h-1:
            if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

            yStarts[x] = -1
            yStrks[x] = 0 x range(w) range w if grid[y][x] == ".":
            if xStart == -1:
                xStart = x
            xStrk += 1

            if yStarts[x] == -1:
                yStarts[x] = y
            yStrks[x] += 1

         grid[y][x] == "." grid[y][x] [y] grid y x "." if xStart == -1:
                xStart = x
             xStart == -1 xStart -1 xStart = x xStart x xStrk += 1 xStrk 1 if yStarts[x] == -1:
                yStarts[x] = y
             yStarts[x] == -1 yStarts[x] yStarts x -1 yStarts[x] = y yStarts[x] yStarts x y yStrks[x] += 1 yStrks[x] yStrks x 1 if grid[y][x] == "#" or x == w-1:
            if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

            xStart = -1
            xStrk = 0

         grid[y][x] == "#" or x == w-1 grid[y][x] == "#" grid[y][x] [y] grid y x "#" x == w-1 x w-1 w 1 if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

             xStart != -1 xStart -1 xEnd = x if grid[y][x] == "." else x-1 xEnd x if grid[y][x] == "." else x-1 grid[y][x] == "." grid[y][x] [y] grid y x "." x x-1 x 1 for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

             x2 range(xStart, xEnd+1) range xStart xEnd+1 xEnd 1 cnt[y][x2] += (xEnd-xStart)+1 cnt[y][x2] [y] cnt y x2 (xEnd-xStart)+1 xEnd-xStart xEnd xStart 1 xStart = -1 xStart -1 xStrk = 0 xStrk 0 if grid[y][x] == "#" or y == h-1:
            if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

            yStarts[x] = -1
            yStrks[x] = 0 grid[y][x] == "#" or y == h-1 grid[y][x] == "#" grid[y][x] [y] grid y x "#" y == h-1 y h-1 h 1 if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

             yStarts[x] != -1 yStarts[x] yStarts x -1 yEnd = y if grid[y][x] == "." else y-1 yEnd y if grid[y][x] == "." else y-1 grid[y][x] == "." grid[y][x] [y] grid y x "." y y-1 y 1 for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

             y2 range(yStarts[x], yEnd+1) range yStarts[x] yStarts x yEnd+1 yEnd 1 cnt[y2][x] += (yEnd-yStarts[x])+1 cnt[y2][x] [y2] cnt y2 x (yEnd-yStarts[x])+1 yEnd-yStarts[x] yEnd yStarts[x] yStarts x 1 yStarts[x] = -1 yStarts[x] yStarts x -1 yStrks[x] = 0 yStrks[x] yStrks x 0 ans = 0 ans 0 for y in range(h):
    for x in range(w):
        ans = max(ans, cnt[y][x]-1) y range(h) range h for x in range(w):
        ans = max(ans, cnt[y][x]-1) x range(w) range w ans = max(ans, cnt[y][x]-1) ans max(ans, cnt[y][x]-1) max ans cnt[y][x]-1 cnt[y][x] [y] cnt y x 1 print(ans) print ans h, w = list(map(int, raw_input().split())) list(map(int, raw_input().split())) h xStrk += 1 1 xStrk xStart = -1 -1 xStart ans = max(ans, cnt[y][x]-1) max(ans, cnt[y][x]-1) ans grid = [raw_input() for _ in range(h)] [raw_input() for _ in range(h)] grid yStarts = [-1] * w [-1] * w yStarts xStart = -1 -1 xStart yEnd = y if grid[y][x] == "." else y-1 y if grid[y][x] == "." else y-1 yEnd w = list(map(int, raw_input().split())) list(map(int, raw_input().split())) w ans = 0 0 ans cnt = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] cnt xStart = x x xStart yStrks = [0] * w [0] * w yStrks xEnd = x if grid[y][x] == "." else x-1 x if grid[y][x] == "." else x-1 xEnd xStrk = 0 0 xStrk xStrk = 0 0 xStrk
h, w = list(map(int, raw_input().split()))
grid = [raw_input() for _ in range(h)]

cnt = [[0]*w for _ in range(h)]

yStarts = [-1] * w
yStrks = [0] * w

for y in range(h):
    xStart = -1
    xStrk = 0

    for x in range(w):
        if grid[y][x] == ".":
            if xStart == -1:
                xStart = x
            xStrk += 1

            if yStarts[x] == -1:
                yStarts[x] = y
            yStrks[x] += 1

        if grid[y][x] == "#" or x == w-1:
            if xStart != -1:
                xEnd = x if grid[y][x] == "." else x-1

                for x2 in range(xStart, xEnd+1):
                    cnt[y][x2] += (xEnd-xStart)+1

            xStart = -1
            xStrk = 0

        if grid[y][x] == "#" or y == h-1:
            if yStarts[x] != -1:
                yEnd = y if grid[y][x] == "." else y-1

                for y2 in range(yStarts[x], yEnd+1):
                    cnt[y2][x] += (yEnd-yStarts[x])+1

            yStarts[x] = -1
            yStrks[x] = 0

ans = 0
for y in range(h):
    for x in range(w):
        ans = max(ans, cnt[y][x]-1)

print(ans)
