import sys

sys.setrecursionlimit(10**9)





def input():

    return sys.stdin.readline().rstrip()





def main():

    H, W = list(map(int, input().split()))

    S = [list(eval(input())) for i in range(H)]

    ans = 0

    memo_y = [[float(-1)]*W for i in range(H)]

    memo_x = [[float(-1)]*W for i in range(H)]

    for y in range(H):

        for x in range(W):

            c = 0

            if S[y][x] == '.':

                c += 1

                c_x = 0

                c_y = 0

                tmp_x = [x]

                tmp_y = [y]

                if memo_x[y][x] == float(-1):

                    for i in range(1, x+1):

                        if S[y][x-i] == '.':

                            c_x += 1

                            tmp_x.append(i)

                        else:

                            break

                    for i in range(x+1, W):

                        if S[y][i] == '.':

                            c_x += 1

                            tmp_x.append(i)

                        else:

                            break

                    for i in tmp_x:

                        memo_x[y][i] = c_x

                else:

                    c_x += memo_x[y][x]

                if memo_y[y][x] == float(-1):

                    for i in range(1, y+1):

                        if S[y-i][x] == '.':

                            c_y += 1

                            tmp_y.append(i)

                        else:

                            break

                    for i in range(y+1, H):

                        if S[i][x] == '.':

                            c_y += 1

                            tmp_y.append(i)

                        else:

                            break

                    for i in tmp_y:

                        memo_y[i][x] = c_y

                else:

                    c_y += memo_y[y][x]

                c += c_x + c_y

            ans = max(ans, c)

    print(ans)





if __name__ == '__main__':

    main()

import sys

sys.setrecursionlimit(10**9)





def input():

    return sys.stdin.readline().rstrip()





def main():

    H, W = list(map(int, input().split()))

    S = [list(eval(input())) for i in range(H)]

    ans = 0

    memo_y = [[-1]*W for i in range(H)]

    memo_x = [[-1]*W for i in range(H)]

    for y in range(H):

        for x in range(W):

            c = 0

            if S[y][x] == '.':

                c += 1

                c_x = 0

                c_y = 0

                tmp_x = [x]

                tmp_y = [y]

                if memo_x[y][x] == -1:

                    for i in range(1, x+1):

                        if S[y][x-i] == '.':

                            c_x += 1

                            tmp_x.append(i)

                        else:

                            break

                    for i in range(x+1, W):

                        if S[y][i] == '.':

                            c_x += 1

                            tmp_x.append(i)

                        else:

                            break

                    for i in tmp_x:

                        memo_x[y][i] = c_x

                else:

                    c_x += memo_x[y][x]

                if memo_y[y][x] == -1:

                    for i in range(1, y+1):

                        if S[y-i][x] == '.':

                            c_y += 1

                            tmp_y.append(i)

                        else:

                            break

                    for i in range(y+1, H):

                        if S[i][x] == '.':

                            c_y += 1

                            tmp_y.append(i)

                        else:

                            break

                    for i in tmp_y:

                        memo_y[i][x] = c_y

                else:

                    c_y += memo_y[y][x]

                c += c_x + c_y

            ans = max(ans, c)

    print(ans)





if __name__ == '__main__':

    main()

import sys

sys.setrecursionlimit(10**9)


def input():
    return sys.stdin.readline().rstrip()


def main():
    H, W = list(map(int, input().split()))
    S = [list(eval(input())) for i in range(H)]
    ans = 0
    memo_y = [[float(-1)] * W for i in range(H)]
    memo_x = [[float(-1)] * W for i in range(H)]
    for y in range(H):
        for x in range(W):
            c = 0
            if S[y][x] == ".":
                c += 1
                c_x = 0
                c_y = 0
                tmp_x = [x]
                tmp_y = [y]
                if memo_x[y][x] == float(-1):
                    for i in range(1, x + 1):
                        if S[y][x - i] == ".":
                            c_x += 1
                            tmp_x.append(i)
                        else:
                            break
                    for i in range(x + 1, W):
                        if S[y][i] == ".":
                            c_x += 1
                            tmp_x.append(i)
                        else:
                            break
                    for i in tmp_x:
                        memo_x[y][i] = c_x
                else:
                    c_x += memo_x[y][x]
                if memo_y[y][x] == float(-1):
                    for i in range(1, y + 1):
                        if S[y - i][x] == ".":
                            c_y += 1
                            tmp_y.append(i)
                        else:
                            break
                    for i in range(y + 1, H):
                        if S[i][x] == ".":
                            c_y += 1
                            tmp_y.append(i)
                        else:
                            break
                    for i in tmp_y:
                        memo_y[i][x] = c_y
                else:
                    c_y += memo_y[y][x]
                c += c_x + c_y
            ans = max(ans, c)
    print(ans)


if __name__ == "__main__":
    main()

import sys

sys.setrecursionlimit(10**9)


def input():
    return sys.stdin.readline().rstrip()


def main():
    H, W = list(map(int, input().split()))
    S = [list(eval(input())) for i in range(H)]
    ans = 0
    memo_y = [[-1] * W for i in range(H)]
    memo_x = [[-1] * W for i in range(H)]
    for y in range(H):
        for x in range(W):
            c = 0
            if S[y][x] == ".":
                c += 1
                c_x = 0
                c_y = 0
                tmp_x = [x]
                tmp_y = [y]
                if memo_x[y][x] == -1:
                    for i in range(1, x + 1):
                        if S[y][x - i] == ".":
                            c_x += 1
                            tmp_x.append(i)
                        else:
                            break
                    for i in range(x + 1, W):
                        if S[y][i] == ".":
                            c_x += 1
                            tmp_x.append(i)
                        else:
                            break
                    for i in tmp_x:
                        memo_x[y][i] = c_x
                else:
                    c_x += memo_x[y][x]
                if memo_y[y][x] == -1:
                    for i in range(1, y + 1):
                        if S[y - i][x] == ".":
                            c_y += 1
                            tmp_y.append(i)
                        else:
                            break
                    for i in range(y + 1, H):
                        if S[i][x] == ".":
                            c_y += 1
                            tmp_y.append(i)
                        else:
                            break
                    for i in tmp_y:
                        memo_y[i][x] = c_y
                else:
                    c_y += memo_y[y][x]
                c += c_x + c_y
            ans = max(ans, c)
    print(ans)


if __name__ == "__main__":
    main()

-    memo_y = [[float(-1)] * W for i in range(H)] -    memo_x = [[float(-1)] * W for i in range(H)] +    memo_y = [[-1] * W for i in range(H)] +    memo_x = [[-1] * W for i in range(H)] -                if memo_x[y][x] == float(-1): +                if memo_x[y][x] == -1: -                if memo_y[y][x] == float(-1): +                if memo_y[y][x] == -1: