def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1)
resolve() def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1) resolve h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) input() input s = [input() for _ in range(h)] s [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 hs = [[0]*w for _ in range(h)] hs [[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 ws = [[0]*w for _ in range(h)] ws [[0]*w for _ in range(h)] for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

     i range(h) range h cums = 0 cums 0 for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
         j range(w) range w if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
         s[i][j] == "#" s[i][j] [i] s i j "#" cums = 0 cums 0 ws[i][j] = 0 ws[i][j] [i] ws i j 0 cums += 1 cums 1 ws[i][j] = cums ws[i][j] [i] ws i j cums for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

     j reversed(range(w-1)) reversed range(w-1) range w-1 w 1 if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

     ws[i][j+1] != 0 and ws[i][j] != 0 ws[i][j+1] != 0 ws[i][j+1] [i] ws i j+1 j 1 0 ws[i][j] != 0 ws[i][j] [i] ws i j 0 ws[i][j] = ws[i][j+1] ws[i][j] [i] ws i j ws[i][j+1] [i] ws i j+1 j 1 for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

     i range(w) range w cums = 0 cums 0 for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
         j range(h) range h if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
         s[j][i] == "#" s[j][i] [j] s j i "#" cums = 0 cums 0 hs[j][i] = 0 hs[j][i] [j] hs j i 0 cums += 1 cums 1 hs[j][i] = cums hs[j][i] [j] hs j i cums for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

     j reversed(range(h-1)) reversed range(h-1) range h-1 h 1 if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

     hs[j+1][i] != 0 and hs[j][i] != 0 hs[j+1][i] != 0 hs[j+1][i] [j+1] hs j+1 j 1 i 0 hs[j][i] != 0 hs[j][i] [j] hs j i 0 hs[j][i] = hs[j+1][i] hs[j][i] [j] hs j i hs[j+1][i] [j+1] hs j+1 j 1 i ans = 0 ans 0 for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
     i range(h) range h for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
     j range(w) range w ans = max(ans, ws[i][j] + hs[i][j]) ans max(ans, ws[i][j] + hs[i][j]) max ans ws[i][j] + hs[i][j] ws[i][j] [i] ws i j hs[i][j] [i] hs i j print(ans-1) print ans-1 ans 1 resolve() resolve def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1) def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1) resolve
def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1)
resolve()