import sys
sys.setrecursionlimit(10**6)

h,w = map(int,input().split())

s = [input() for _ in range(h)]
cnt = [[0] * w for _ in range(h)]

for i in range(h):
    done = [0] * w

    for j in range(w):
        if s[i][j] == '#': continue
        if done[j]: continue

        l = 0
        while j+l < w:
            if s[i][j+l] == '#': break
            l += 1

        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1

for j in range(w):
    done = [0] * h

    for i in range(h):
        if s[i][j] == '#': continue
        if done[i] :continue

        l = 0
        while i+l < h:
            if s[i+l][j] == '#': break
            l += 1

        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, cnt[i][j]-1)

print(ans) import sys sys sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 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 cnt = [[0] * w for _ in range(h)] cnt [[0] * w for _ in range(h)] for i in range(h):
    done = [0] * w

    for j in range(w):
        if s[i][j] == '#': continue
        if done[j]: continue

        l = 0
        while j+l < w:
            if s[i][j+l] == '#': break
            l += 1

        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1 i range(h) range h done = [0] * w done [0] * w [0] 0 w for j in range(w):
        if s[i][j] == '#': continue
        if done[j]: continue

        l = 0
        while j+l < w:
            if s[i][j+l] == '#': break
            l += 1

        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1 j range(w) range w if s[i][j] == '#': continue
         s[i][j] == '#' s[i][j] [i] s i j '#' if done[j]: continue

         done[j] done j l = 0 l 0 while j+l < w:
            if s[i][j+l] == '#': break
            l += 1

         j+l < w j+l j l w if s[i][j+l] == '#': break
             s[i][j+l] == '#' s[i][j+l] [i] s i j+l j l '#' l += 1 l 1 for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1 k range(l) range l cnt[i][j+k] += l cnt[i][j+k] [i] cnt i j+k j k l done[j+k] = 1 done[j+k] done j+k j k 1 for j in range(w):
    done = [0] * h

    for i in range(h):
        if s[i][j] == '#': continue
        if done[i] :continue

        l = 0
        while i+l < h:
            if s[i+l][j] == '#': break
            l += 1

        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1 j range(w) range w done = [0] * h done [0] * h [0] 0 h for i in range(h):
        if s[i][j] == '#': continue
        if done[i] :continue

        l = 0
        while i+l < h:
            if s[i+l][j] == '#': break
            l += 1

        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1 i range(h) range h if s[i][j] == '#': continue
         s[i][j] == '#' s[i][j] [i] s i j '#' if done[i] :continue

         done[i] done i l = 0 l 0 while i+l < h:
            if s[i+l][j] == '#': break
            l += 1

         i+l < h i+l i l h if s[i+l][j] == '#': break
             s[i+l][j] == '#' s[i+l][j] [i+l] s i+l i l j '#' l += 1 l 1 for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1 k range(l) range l cnt[i+k][j] += l cnt[i+k][j] [i+k] cnt i+k i k j l done[i+k] = 1 done[i+k] done i+k i k 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, cnt[i][j]-1) i range(h) range h for j in range(w):
        ans = max(ans, cnt[i][j]-1) j range(w) range w ans = max(ans, cnt[i][j]-1) ans max(ans, cnt[i][j]-1) max ans cnt[i][j]-1 cnt[i][j] [i] cnt i j 1 print(ans) print ans s = [input() for _ in range(h)] [input() for _ in range(h)] s h,w = map(int,input().split()) map(int,input().split()) h cnt = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt done = [0] * w [0] * w done l = 0 0 l l += 1 1 l w = map(int,input().split()) map(int,input().split()) w ans = 0 0 ans done = [0] * h [0] * h done ans = max(ans, cnt[i][j]-1) max(ans, cnt[i][j]-1) ans l = 0 0 l l += 1 1 l
import sys
sys.setrecursionlimit(10**6)

h,w = map(int,input().split())

s = [input() for _ in range(h)]
cnt = [[0] * w for _ in range(h)]

for i in range(h):
    done = [0] * w

    for j in range(w):
        if s[i][j] == '#': continue
        if done[j]: continue

        l = 0
        while j+l < w:
            if s[i][j+l] == '#': break
            l += 1

        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1

for j in range(w):
    done = [0] * h

    for i in range(h):
        if s[i][j] == '#': continue
        if done[i] :continue

        l = 0
        while i+l < h:
            if s[i+l][j] == '#': break
            l += 1

        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, cnt[i][j]-1)

print(ans)