import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W = map(int, input().split())
    grid = [list(input().rstrip()) for _ in range(H)]

    cnt_w = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

    cnt_h = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

    res = 0
    for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
    print(res)


if __name__ == '__main__':
    resolve() import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline f_inf = float('inf') f_inf float('inf') float 'inf' mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def resolve():
    H, W = map(int, input().split())
    grid = [list(input().rstrip()) for _ in range(H)]

    cnt_w = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

    cnt_h = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

    res = 0
    for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
    print(res) resolve H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W list(input().rstrip()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input().rstrip()) list input().rstrip() ().rstrip () input rstrip grid = [list(input().rstrip()) for _ in range(H)] grid [list(input().rstrip()) 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_w = [[0] * W for _ in range(H)] cnt_w [[0] * W for _ in range(H)] for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

     h range(H) range H cnt = 0 cnt 0 for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

     w range(W) range W if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
             grid[h][w] == "#" grid[h][w] [h] grid h w "#" cnt = 0 cnt 0 cnt += 1 cnt 1 cnt_w[h][w] = cnt cnt_w[h][w] [h] cnt_w h w cnt for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

     h range(H) range H cnt = 0 cnt 0 for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

     w reversed(range(W)) reversed range(W) range W if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
             grid[h][w] == "#" grid[h][w] [h] grid h w "#" cnt = 0 cnt 0 cnt = max(cnt, cnt_w[h][w]) cnt max(cnt, cnt_w[h][w]) max cnt cnt_w[h][w] [h] cnt_w h w cnt_w[h][w] = cnt cnt_w[h][w] [h] cnt_w 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 cnt_h = [[0] * W for _ in range(H)] cnt_h [[0] * W for _ in range(H)] for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

     w range(W) range W cnt = 0 cnt 0 for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

     h range(H) range H if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
             grid[h][w] == "#" grid[h][w] [h] grid h w "#" cnt = 0 cnt 0 cnt += 1 cnt 1 cnt_h[h][w] = cnt cnt_h[h][w] [h] cnt_h h w cnt for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

     w range(W) range W cnt = 0 cnt 0 for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

     h reversed(range(H)) reversed range(H) range H if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
             grid[h][w] == "#" grid[h][w] [h] grid h w "#" cnt = 0 cnt 0 cnt = max(cnt, cnt_h[h][w]) cnt max(cnt, cnt_h[h][w]) max cnt cnt_h[h][w] [h] cnt_h h w cnt_h[h][w] = cnt cnt_h[h][w] [h] cnt_h h w cnt res = 0 res 0 for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
     h range(H) range H for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
     w range(W) range W res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1) res max(res, cnt_w[h][w] + cnt_h[h][w] - 1) max res cnt_w[h][w] + cnt_h[h][w] - 1 cnt_w[h][w] + cnt_h[h][w] cnt_w[h][w] [h] cnt_w h w cnt_h[h][w] [h] cnt_h h w 1 print(res) print res if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve mod = 10 ** 9 + 7 10 ** 9 + 7 mod f_inf = float('inf') float('inf') f_inf def resolve():
    H, W = map(int, input().split())
    grid = [list(input().rstrip()) for _ in range(H)]

    cnt_w = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

    cnt_h = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

    res = 0
    for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
    print(res) def resolve():
    H, W = map(int, input().split())
    grid = [list(input().rstrip()) for _ in range(H)]

    cnt_w = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

    cnt_h = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

    res = 0
    for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
    print(res) resolve input = sys.stdin.readline sys.stdin.readline input
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W = map(int, input().split())
    grid = [list(input().rstrip()) for _ in range(H)]

    cnt_w = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_w[h][w] = cnt

    for h in range(H):
        cnt = 0
        for w in reversed(range(W)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_w[h][w])
            cnt_w[h][w] = cnt

    cnt_h = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
            cnt_h[h][w] = cnt

    for w in range(W):
        cnt = 0
        for h in reversed(range(H)):
            if grid[h][w] == "#":
                cnt = 0
            else:
                cnt = max(cnt, cnt_h[h][w])
            cnt_h[h][w] = cnt

    res = 0
    for h in range(H):
        for w in range(W):
            res = max(res, cnt_w[h][w] + cnt_h[h][w] - 1)
    print(res)


if __name__ == '__main__':
    resolve()
