

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

l = [list(eval(input())) for i in range(h)]



c1 = [[0 for i in range(w)] for i in range(h)]

c2 = [[0 for i in range(w)] for i in range(h)]

ans = 0

for i in range(h):

    for j in range(w):

        if c1[i][j] == 0:

            n = 0

            k = i

            while k < h:

                if l[k][j] == ".":

                    n +=1

                    k += 1

                else:

                    break

            for r in range(i,k):

                c1[r][j] = n

            

        if c2[i][j] == 0:

            n = 0

            k = j

            while k < w:

                if l[i][k] == ".":

                    n +=1

                    k += 1

                else:

                    break

            for r in range(j,k):

                c2[i][r] = n





        ans = max(ans,c1[i][j]+c2[i][j])

print((ans-1))
def main():



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

    l = [list(eval(input())) for i in range(h)]



    c1 = [[0 for i in range(w)] for i in range(h)]

    c2 = [[0 for i in range(w)] for i in range(h)]

    ans = 0

    for i in range(h):

        for j in range(w):

            if c1[i][j] == 0:

                n = 0

                k = i

                while k < h:

                    if l[k][j] == ".":

                        n +=1

                        k += 1

                    else:

                        break

                for r in range(i,k):

                    c1[r][j] = n

                

            if c2[i][j] == 0:

                n = 0

                k = j

                while k < w:

                    if l[i][k] == ".":

                        n +=1

                        k += 1

                    else:

                        break

                for r in range(j,k):

                    c2[i][r] = n





            ans = max(ans,c1[i][j]+c2[i][j])

    print((ans-1))

if __name__ == "__main__":

    main()
h, w = list(map(int, input().split()))
l = [list(eval(input())) for i in range(h)]
c1 = [[0 for i in range(w)] for i in range(h)]
c2 = [[0 for i in range(w)] for i in range(h)]
ans = 0
for i in range(h):
    for j in range(w):
        if c1[i][j] == 0:
            n = 0
            k = i
            while k < h:
                if l[k][j] == ".":
                    n += 1
                    k += 1
                else:
                    break
            for r in range(i, k):
                c1[r][j] = n
        if c2[i][j] == 0:
            n = 0
            k = j
            while k < w:
                if l[i][k] == ".":
                    n += 1
                    k += 1
                else:
                    break
            for r in range(j, k):
                c2[i][r] = n
        ans = max(ans, c1[i][j] + c2[i][j])
print((ans - 1))

def main():
    h, w = list(map(int, input().split()))
    l = [list(eval(input())) for i in range(h)]
    c1 = [[0 for i in range(w)] for i in range(h)]
    c2 = [[0 for i in range(w)] for i in range(h)]
    ans = 0
    for i in range(h):
        for j in range(w):
            if c1[i][j] == 0:
                n = 0
                k = i
                while k < h:
                    if l[k][j] == ".":
                        n += 1
                        k += 1
                    else:
                        break
                for r in range(i, k):
                    c1[r][j] = n
            if c2[i][j] == 0:
                n = 0
                k = j
                while k < w:
                    if l[i][k] == ".":
                        n += 1
                        k += 1
                    else:
                        break
                for r in range(j, k):
                    c2[i][r] = n
            ans = max(ans, c1[i][j] + c2[i][j])
    print((ans - 1))


if __name__ == "__main__":
    main()

-h, w = list(map(int, input().split())) -l = [list(eval(input())) for i in range(h)] -c1 = [[0 for i in range(w)] for i in range(h)] -c2 = [[0 for i in range(w)] for i in range(h)] -ans = 0 -for i in range(h): -    for j in range(w): -        if c1[i][j] == 0: -            n = 0 -            k = i -            while k < h: -                if l[k][j] == ".": -                    n += 1 -                    k += 1 -                else: -                    break -            for r in range(i, k): -                c1[r][j] = n -        if c2[i][j] == 0: -            n = 0 -            k = j -            while k < w: -                if l[i][k] == ".": -                    n += 1 -                    k += 1 -                else: -                    break -            for r in range(j, k): -                c2[i][r] = n -        ans = max(ans, c1[i][j] + c2[i][j]) -print((ans - 1)) +def main(): +    h, w = list(map(int, input().split())) +    l = [list(eval(input())) for i in range(h)] +    c1 = [[0 for i in range(w)] for i in range(h)] +    c2 = [[0 for i in range(w)] for i in range(h)] +    ans = 0 +    for i in range(h): +        for j in range(w): +            if c1[i][j] == 0: +                n = 0 +                k = i +                while k < h: +                    if l[k][j] == ".": +                        n += 1 +                        k += 1 +                    else: +                        break +                for r in range(i, k): +                    c1[r][j] = n +            if c2[i][j] == 0: +                n = 0 +                k = j +                while k < w: +                    if l[i][k] == ".": +                        n += 1 +                        k += 1 +                    else: +                        break +                for r in range(j, k): +                    c2[i][r] = n +            ans = max(ans, c1[i][j] + c2[i][j]) +    print((ans - 1)) + + +if __name__ == "__main__": +    main()