def main():
    H, W = (int(i) for i in input().split())
    A = [input() for i in range(H)]
    L = [[[0]*W for _ in range(H)] for _ in range(4)]
    for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
    print(ans)


if __name__ == '__main__':
    main() def main():
    H, W = (int(i) for i in input().split())
    A = [input() for i in range(H)]
    L = [[[0]*W for _ in range(H)] for _ in range(4)]
    for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
    print(ans) main int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i H, W = (int(i) for i in input().split()) H (int(i) for i in input().split()) W input() for i in range(H) for i in range(H) i range(H) range H for i in range(H) input() input A = [input() for i in range(H)] A [input() for i in range(H)] [[0]*W for _ in range(H)] for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) [[0]*W for _ in range(H)] L = [[[0]*W for _ in range(H)] for _ in range(4)] L [[[0]*W for _ in range(H)] for _ in range(4)] for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     di range(4) range 4 if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

         di == 0 or di == 1 di == 0 di 0 di == 1 di 1 rangeH = range(H) rangeH range(H) range H rangeW = range(W) rangeW range(W) range W rangeH = range(H)[::-1] rangeH range(H)[::-1] (H) range H ::-1 -1 rangeW = range(W)[::-1] rangeW range(W)[::-1] (W) range W ::-1 -1 for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     h rangeH for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     w rangeW if A[h][w] == "#":
                    continue
                 A[h][w] == "#" A[h][w] [h] A h w "#" continue if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     di == 0 di 0 if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                 h-1 < 0 or A[h-1][w] == "#" h-1 < 0 h-1 h 1 0 A[h-1][w] == "#" A[h-1][w] [h-1] A h-1 h 1 w "#" L[di][h][w] = 1 L[di][h][w] [h] [di] L di h w 1 L[di][h][w] = L[di][h-1][w] + 1 L[di][h][w] [h] [di] L di h w L[di][h-1][w] + 1 L[di][h-1][w] [h-1] [di] L di h-1 h 1 w 1 elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                 di == 1 di 1 if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                 w-1 < 0 or A[h][w-1] == "#" w-1 < 0 w-1 w 1 0 A[h][w-1] == "#" A[h][w-1] [h] A h w-1 w 1 "#" L[di][h][w] = 1 L[di][h][w] [h] [di] L di h w 1 L[di][h][w] = L[di][h][w-1] + 1 L[di][h][w] [h] [di] L di h w L[di][h][w-1] + 1 L[di][h][w-1] [h] [di] L di h w-1 w 1 1 elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                 di == 2 di 2 if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                 h+1 > H-1 or A[h+1][w] == "#" h+1 > H-1 h+1 h 1 H-1 H 1 A[h+1][w] == "#" A[h+1][w] [h+1] A h+1 h 1 w "#" L[di][h][w] = 1 L[di][h][w] [h] [di] L di h w 1 L[di][h][w] = L[di][h+1][w] + 1 L[di][h][w] [h] [di] L di h w L[di][h+1][w] + 1 L[di][h+1][w] [h+1] [di] L di h+1 h 1 w 1 elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     di == 3 di 3 if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
     w+1 > W-1 or A[h][w+1] == "#" w+1 > W-1 w+1 w 1 W-1 W 1 A[h][w+1] == "#" A[h][w+1] [h] A h w+1 w 1 "#" L[di][h][w] = 1 L[di][h][w] [h] [di] L di h w 1 L[di][h][w] = L[di][h][w+1] + 1 L[di][h][w] [h] [di] L di h w L[di][h][w+1] + 1 L[di][h][w+1] [h] [di] L di h w+1 w 1 1 ans = 0 ans 0 for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
     h range(H) range H for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
     w range(W) range W v = sum(L[i][h][w] for i in range(4)) - 3 v sum(L[i][h][w] for i in range(4)) - 3 sum(L[i][h][w] for i in range(4)) sum L[i][h][w] [h] [i] L i h w 3 ans = max(ans, v) ans max(ans, v) max ans v print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    H, W = (int(i) for i in input().split())
    A = [input() for i in range(H)]
    L = [[[0]*W for _ in range(H)] for _ in range(4)]
    for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
    print(ans) def main():
    H, W = (int(i) for i in input().split())
    A = [input() for i in range(H)]
    L = [[[0]*W for _ in range(H)] for _ in range(4)]
    for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
    print(ans) main
def main():
    H, W = (int(i) for i in input().split())
    A = [input() for i in range(H)]
    L = [[[0]*W for _ in range(H)] for _ in range(4)]
    for di in range(4):
        if di == 0 or di == 1:
            rangeH = range(H)
            rangeW = range(W)
        else:
            rangeH = range(H)[::-1]
            rangeW = range(W)[::-1]

        for h in rangeH:
            for w in rangeW:
                if A[h][w] == "#":
                    continue
                if di == 0:
                    if h-1 < 0 or A[h-1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h-1][w] + 1
                elif di == 1:
                    if w-1 < 0 or A[h][w-1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w-1] + 1
                elif di == 2:
                    if h+1 > H-1 or A[h+1][w] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h+1][w] + 1
                elif di == 3:
                    if w+1 > W-1 or A[h][w+1] == "#":
                        L[di][h][w] = 1
                    else:
                        L[di][h][w] = L[di][h][w+1] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            v = sum(L[i][h][w] for i in range(4)) - 3
            ans = max(ans, v)
    print(ans)


if __name__ == '__main__':
    main()
