import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


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

    l = [[0] * W for _ in range(H)]
    r = [[0] * W for _ in range(H)]
    u = [[0] * W for _ in range(H)]
    d = [[0] * W for _ in range(H)]

    for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

    for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

    for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

    for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
    print(ans)


resolve() import sys sys sys.setrecursionlimit(10 ** 5 + 10) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 + 10 10 ** 5 10 5 10 def input(): return sys.stdin.readline().strip() input def resolve():
    H, W = map(int, input().split())
    grid = [[_ for _ in input()] for _ in range(H)]

    l = [[0] * W for _ in range(H)]
    r = [[0] * W for _ in range(H)]
    u = [[0] * W for _ in range(H)]
    d = [[0] * W for _ in range(H)]

    for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

    for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

    for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

    for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
    print(ans) resolve H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [_ for _ in input()] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [_ for _ in input()] grid = [[_ for _ in input()] for _ in range(H)] grid [[_ for _ in 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 l = [[0] * W for _ in range(H)] l [[0] * W 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 r = [[0] * W for _ in range(H)] r [[0] * W 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 u = [[0] * W for _ in range(H)] u [[0] * W 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 d = [[0] * W for _ in range(H)] d [[0] * W for _ in range(H)] for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

     h range(H) range H cur = 0 cur 0 for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

     w range(W) range W if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
             grid[h][w] == '#' grid[h][w] [h] grid h w '#' cur = 0 cur 0 cur += 1 cur 1 l[h][w] = cur l[h][w] [h] l h w cur for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

     h range(H) range H cur = 0 cur 0 for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

     w reversed(range(W)) reversed range(W) range W if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
             grid[h][w] == '#' grid[h][w] [h] grid h w '#' cur = 0 cur 0 cur += 1 cur 1 r[h][w] = cur r[h][w] [h] r h w cur for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

     w range(W) range W cur = 0 cur 0 for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

     h range(H) range H if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
             grid[h][w] == '#' grid[h][w] [h] grid h w '#' cur = 0 cur 0 cur += 1 cur 1 u[h][w] = cur u[h][w] [h] u h w cur for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

     w range(W) range W cur = 0 cur 0 for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

     h reversed(range(H)) reversed range(H) range H if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
             grid[h][w] == '#' grid[h][w] [h] grid h w '#' cur = 0 cur 0 cur += 1 cur 1 d[h][w] = cur d[h][w] [h] d h w cur ans = 0 ans 0 for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
     h range(H) range H for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
     w range(W) range W ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3) ans max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3) max ans r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3 r[h][w] + l[h][w] + u[h][w] + d[h][w] r[h][w] + l[h][w] + u[h][w] r[h][w] + l[h][w] r[h][w] [h] r h w l[h][w] [h] l h w u[h][w] [h] u h w d[h][w] [h] d h w 3 print(ans) print ans resolve() resolve def resolve():
    H, W = map(int, input().split())
    grid = [[_ for _ in input()] for _ in range(H)]

    l = [[0] * W for _ in range(H)]
    r = [[0] * W for _ in range(H)]
    u = [[0] * W for _ in range(H)]
    d = [[0] * W for _ in range(H)]

    for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

    for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

    for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

    for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
    print(ans) def resolve():
    H, W = map(int, input().split())
    grid = [[_ for _ in input()] for _ in range(H)]

    l = [[0] * W for _ in range(H)]
    r = [[0] * W for _ in range(H)]
    u = [[0] * W for _ in range(H)]
    d = [[0] * W for _ in range(H)]

    for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

    for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

    for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

    for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
    print(ans) resolve def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


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

    l = [[0] * W for _ in range(H)]
    r = [[0] * W for _ in range(H)]
    u = [[0] * W for _ in range(H)]
    d = [[0] * W for _ in range(H)]

    for h in range(H):
        cur = 0
        for w in range(W):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            l[h][w] = cur

    for h in range(H):
        cur = 0
        for w in reversed(range(W)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            r[h][w] = cur

    for w in range(W):
        cur = 0
        for h in range(H):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            u[h][w] = cur

    for w in range(W):
        cur = 0
        for h in reversed(range(H)):
            if grid[h][w] == '#':
                cur = 0
            else:
                cur += 1
            d[h][w] = cur

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, r[h][w] + l[h][w] + u[h][w] + d[h][w] - 3)
    print(ans)


resolve()