def make_mat(grid, H, W):
    res = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
    return res

def max2(x,y):
    return x if x > y else y


import sys
input = sys.stdin.readline

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


grid = []
grid_t = [0]*W
for h in range(H):
    temp = 0
    for w, s in enumerate(input().rstrip()):
        if s=="#":
            temp += 1<<w
            grid_t[w] += 1<<h
    grid.append(temp)

A = make_mat(grid, H, W)
B = make_mat(grid_t, W, H)

res = 0
for h in range(H):
    for w in range(W):
        res = max2(A[h][w] + B[w][h], res)

print(res-1) def make_mat(grid, H, W):
    res = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
    return res make_mat [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W res = [[0] * W for _ in range(H)] res [[0] * W for _ in range(H)] for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
     h range(H) range H cnt = 0 cnt 0 for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
         w range(W) range W if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
         (grid[h]>>w)&1 == 1 (grid[h]>>w)&1 grid[h]>>w grid[h] grid h w 1 1 for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                 i range(cnt) range cnt res[h][w - 1 - i] = cnt res[h][w - 1 - i] [h] res h w - 1 - i w - 1 w 1 i cnt cnt = 0 cnt 0 cnt += 1 cnt 1 if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
     (grid[h]>>w)&1 == 0 (grid[h]>>w)&1 grid[h]>>w grid[h] grid h w 1 0 for i in range(cnt):
                res[h][w - i] = cnt
     i range(cnt) range cnt res[h][w - i] = cnt res[h][w - i] [h] res h w - i w i cnt return res res grid grid H H W W def max2(x,y):
    return x if x > y else y max2 return x if x > y else y x if x > y else y x > y x y x y x x y y import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W grid = [] grid [] grid_t = [0]*W grid_t [0]*W [0] 0 W for h in range(H):
    temp = 0
    for w, s in enumerate(input().rstrip()):
        if s=="#":
            temp += 1<<w
            grid_t[w] += 1<<h
    grid.append(temp) h range(H) range H temp = 0 temp 0 for w, s in enumerate(input().rstrip()):
        if s=="#":
            temp += 1<<w
            grid_t[w] += 1<<h
     w s enumerate(input().rstrip()) enumerate input().rstrip() ().rstrip () input rstrip if s=="#":
            temp += 1<<w
            grid_t[w] += 1<<h
     s=="#" s "#" temp += 1<<w temp 1<<w 1 w grid_t[w] += 1<<h grid_t[w] grid_t w 1<<h 1 h grid.append(temp) grid.append grid append temp A = make_mat(grid, H, W) A make_mat(grid, H, W) make_mat grid H W B = make_mat(grid_t, W, H) B make_mat(grid_t, W, H) make_mat grid_t W H res = 0 res 0 for h in range(H):
    for w in range(W):
        res = max2(A[h][w] + B[w][h], res) h range(H) range H for w in range(W):
        res = max2(A[h][w] + B[w][h], res) w range(W) range W res = max2(A[h][w] + B[w][h], res) res max2(A[h][w] + B[w][h], res) max2 A[h][w] + B[w][h] A[h][w] [h] A h w B[w][h] [w] B w h res print(res-1) print res-1 res 1 input = sys.stdin.readline sys.stdin.readline input H, W = map(int, input().split()) map(int, input().split()) H W = map(int, input().split()) map(int, input().split()) W temp = 0 0 temp B = make_mat(grid_t, W, H) make_mat(grid_t, W, H) B res = max2(A[h][w] + B[w][h], res) max2(A[h][w] + B[w][h], res) res def make_mat(grid, H, W):
    res = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
    return res def make_mat(grid, H, W):
    res = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
    return res make_mat def max2(x,y):
    return x if x > y else y def max2(x,y):
    return x if x > y else y max2 grid = [] [] grid res = 0 0 res grid_t = [0]*W [0]*W grid_t A = make_mat(grid, H, W) make_mat(grid, H, W) A temp += 1<<w 1<<w temp
def make_mat(grid, H, W):
    res = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if (grid[h]>>w)&1 == 1:
                for i in range(cnt):
                    res[h][w - 1 - i] = cnt
                cnt = 0
            else:
                cnt += 1
        if (grid[h]>>w)&1 == 0:
            for i in range(cnt):
                res[h][w - i] = cnt
    return res

def max2(x,y):
    return x if x > y else y


import sys
input = sys.stdin.readline

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


grid = []
grid_t = [0]*W
for h in range(H):
    temp = 0
    for w, s in enumerate(input().rstrip()):
        if s=="#":
            temp += 1<<w
            grid_t[w] += 1<<h
    grid.append(temp)

A = make_mat(grid, H, W)
B = make_mat(grid_t, W, H)

res = 0
for h in range(H):
    for w in range(W):
        res = max2(A[h][w] + B[w][h], res)

print(res-1)