def main():
    h,w = map(int,input().split())
    s = [list(input()) for _ in range(h)]

    cnt = [[0]*w for _ in range(h)]
    for i in range(h):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
    for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
    res = 0
    for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
    print(res)

if __name__ == '__main__':
    main() def main():
    h,w = map(int,input().split())
    s = [list(input()) for _ in range(h)]

    cnt = [[0]*w for _ in range(h)]
    for i in range(h):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
    for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
    res = 0
    for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
    print(res) main h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w list(input()) for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) list(input()) list input() input s = [list(input()) for _ in range(h)] s [list(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):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
     i range(h) range h prev = [0]*w prev [0]*w [0] 0 w for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
     j range(w) range w if s[i][j] == '#':
                continue
             s[i][j] == '#' s[i][j] [i] s i j '#' continue if prev[j] == 1:
                continue
             prev[j] == 1 prev[j] prev j 1 continue ln = 0 ln 0 while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
             j+ln < w j+ln j ln w if s[i][j+ln] == '#':
                    break
                 s[i][j+ln] == '#' s[i][j+ln] [i] s i j+ln j ln '#' break ln += 1 ln 1 for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
     k range(ln) range ln cnt[i][j+k] += ln cnt[i][j+k] [i] cnt i j+k j k ln prev[j+k] = 1 prev[j+k] prev j+k j k 1 for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
     j range(w) range w prev = [0]*h prev [0]*h [0] 0 h for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
     i range(h) range h if s[i][j] == '#':
                continue
             s[i][j] == '#' s[i][j] [i] s i j '#' continue if prev[i] == 1:
                continue
             prev[i] == 1 prev[i] prev i 1 continue ln = 0 ln 0 while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
             i+ln < h i+ln i ln h if s[i+ln][j] == '#':
                    break
                 s[i+ln][j] == '#' s[i+ln][j] [i+ln] s i+ln i ln j '#' break ln += 1 ln 1 for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
     k range(ln) range ln cnt[i+k][j] += ln cnt[i+k][j] [i+k] cnt i+k i k j ln prev[i+k] = 1 prev[i+k] prev i+k i k 1 res = 0 res 0 for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
     i range(h) range h for j in range(w):
            res = max(res, cnt[i][j]-1)
     j range(w) range w res = max(res, cnt[i][j]-1) res max(res, cnt[i][j]-1) max res cnt[i][j]-1 cnt[i][j] [i] cnt i j 1 print(res) print res if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    h,w = map(int,input().split())
    s = [list(input()) for _ in range(h)]

    cnt = [[0]*w for _ in range(h)]
    for i in range(h):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
    for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
    res = 0
    for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
    print(res) def main():
    h,w = map(int,input().split())
    s = [list(input()) for _ in range(h)]

    cnt = [[0]*w for _ in range(h)]
    for i in range(h):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
    for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
    res = 0
    for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
    print(res) main
def main():
    h,w = map(int,input().split())
    s = [list(input()) for _ in range(h)]

    cnt = [[0]*w for _ in range(h)]
    for i in range(h):
        prev = [0]*w
        for j in range(w):
            if s[i][j] == '#':
                continue
            if prev[j] == 1:
                continue
            ln = 0
            while j+ln < w:
                if s[i][j+ln] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i][j+k] += ln
                prev[j+k] = 1
    for j in range(w):
        prev = [0]*h
        for i in range(h):
            if s[i][j] == '#':
                continue
            if prev[i] == 1:
                continue
            ln = 0
            while i+ln < h:
                if s[i+ln][j] == '#':
                    break
                ln += 1
            for k in range(ln):
                cnt[i+k][j] += ln
                prev[i+k] = 1
    res = 0
    for i in range(h):
        for j in range(w):
            res = max(res, cnt[i][j]-1)
    print(res)

if __name__ == '__main__':
    main()
