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())
    S = [list(list(input().rstrip())) for _ in range(H)]

    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(range(W)):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

    res = 0
    for h in range(H):
        for w in range(W):
            C = CW[h][w] + CH[h][w] - 1
            res = max(res, C)
    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())
    S = [list(list(input().rstrip())) for _ in range(H)]

    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(range(W)):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

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

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

     w reversed(range(W)) reversed range(W) range W if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

     S[h][w] == "." S[h][w] [h] S h w "." cnt = max(cnt, CW[h][w]) cnt max(cnt, CW[h][w]) max cnt CW[h][w] [h] CW h w CW[h][w] = cnt CW[h][w] [h] CW h w cnt cnt = 0 cnt 0 [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W CH = [[0] * W for _ in range(H)] CH [[0] * W for _ in range(H)] for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

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

     h reversed(range(H)) reversed range(H) range H if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

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

    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(range(W)):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

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

    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(range(W)):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

    res = 0
    for h in range(H):
        for w in range(W):
            C = CW[h][w] + CH[h][w] - 1
            res = max(res, C)
    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())
    S = [list(list(input().rstrip())) for _ in range(H)]

    CW = [[0] * W for _ in range(H)]
    for h in range(H):
        cnt = 0
        for w in range(W):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CW[h][w] = cnt
        cnt = 0
        for w in reversed(range(W)):
            if S[h][w] == ".":
                cnt = max(cnt, CW[h][w])
                CW[h][w] = cnt
            else:
                cnt = 0

    CH = [[0] * W for _ in range(H)]
    for w in range(W):
        cnt = 0
        for h in range(H):
            if S[h][w] == "#":
                cnt = 0
            else:
                cnt += 1
                CH[h][w] = cnt
        cnt = 0
        for h in reversed(range(H)):
            if S[h][w] == ".":
                cnt = max(cnt, CH[h][w])
                CH[h][w] = cnt
            else:
                cnt = 0

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


if __name__ == '__main__':
    resolve()
