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()))

maze = [eval(input()) for _ in range(h)]



dph = [[0 for _ in range(w)] for _ in range(h)]

dpw = [[0 for _ in range(w)] for _ in range(h)]



for i in range(h):

  for j in range(w):

    if maze[i][j] == '#':

      continue

    if dpw[i][j] != 0:

      continue

    k = j

    count = 0

    while k< w:

      

      if maze[i][k] == '.':

        count += 1

        k += 1

      else:

        break

    for l in range(j,k):

      dpw[i][l] = count

      

for i in range(w):

  for j in range(h):

    if maze[j][i] == '#':

      continue

    if dph[j][i] != 0:

      continue

    k = j

    count = 0

    while k< h:

      

      if maze[k][i] == '.':

        count += 1

        k += 1

      else:

        break

    for l in range(j,k):

      dph[l][i] = count





ans = 0

for i in range(h):

  for j in range(w):

    ans = max(ans, dpw[i][j] + dph[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()))
maze = [eval(input()) for _ in range(h)]
dph = [[0 for _ in range(w)] for _ in range(h)]
dpw = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    for j in range(w):
        if maze[i][j] == "#":
            continue
        if dpw[i][j] != 0:
            continue
        k = j
        count = 0
        while k < w:
            if maze[i][k] == ".":
                count += 1
                k += 1
            else:
                break
        for l in range(j, k):
            dpw[i][l] = count
for i in range(w):
    for j in range(h):
        if maze[j][i] == "#":
            continue
        if dph[j][i] != 0:
            continue
        k = j
        count = 0
        while k < h:
            if maze[k][i] == ".":
                count += 1
                k += 1
            else:
                break
        for l in range(j, k):
            dph[l][i] = count
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, dpw[i][j] + dph[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())) +maze = [eval(input()) for _ in range(h)] +dph = [[0 for _ in range(w)] for _ in range(h)] +dpw = [[0 for _ in range(w)] for _ in range(h)] +for i in range(h): +    for j in range(w): +        if maze[i][j] == "#": +            continue +        if dpw[i][j] != 0: +            continue +        k = j +        count = 0 +        while k < w: +            if maze[i][k] == ".": +                count += 1 +                k += 1 +            else: +                break +        for l in range(j, k): +            dpw[i][l] = count +for i in range(w): +    for j in range(h): +        if maze[j][i] == "#": +            continue +        if dph[j][i] != 0: +            continue +        k = j +        count = 0 +        while k < h: +            if maze[k][i] == ".": +                count += 1 +                k += 1 +            else: +                break +        for l in range(j, k): +            dph[l][i] = count +ans = 0 +for i in range(h): +    for j in range(w): +        ans = max(ans, dpw[i][j] + dph[i][j]) +print((ans - 1))