import sys
sys.setrecursionlimit(10**9)

def main():
    H,W = map(int,input().split())
    graph = [[""]*W for _ in range(H)]

    for h in range(H):
        graph[h] = list(input())

    left = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

    right = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

    down = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

    up = [[1]*W for _ in range(H)]
    for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


    print(ans)
    # print(up,"\n",down,"\n",left,"\n",right)
    # print(down)

if __name__ == "__main__":
  main() import sys sys sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 def main():
    H,W = map(int,input().split())
    graph = [[""]*W for _ in range(H)]

    for h in range(H):
        graph[h] = list(input())

    left = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

    right = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

    down = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

    up = [[1]*W for _ in range(H)]
    for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


    print(ans)
    # print(up,"\n",down,"\n",left,"\n",right)
    # print(down) main H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W [""]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [""]*W [""] "" W graph = [[""]*W for _ in range(H)] graph [[""]*W for _ in range(H)] for h in range(H):
        graph[h] = list(input())

     h range(H) range H graph[h] = list(input()) graph[h] graph h list(input()) list input() input [1]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [1]*W [1] 1 W left = [[1]*W for _ in range(H)] left [[1]*W for _ in range(H)] for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

     h range(H) range H for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

     w range(W) range W if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

     graph[h][w] == "#" graph[h][w] [h] graph h w "#" left[h][w] = 0 left[h][w] [h] left h w 0 if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

     w-1 >= 0 w-1 w 1 0 left[h][w] = left[h][w-1] + 1 left[h][w] [h] left h w left[h][w-1] + 1 left[h][w-1] [h] left h w-1 w 1 1 [1]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [1]*W [1] 1 W right = [[1]*W for _ in range(H)] right [[1]*W for _ in range(H)] for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

     h range(H) range H for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

     w reversed(range(W)) reversed range(W) range W if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

     graph[h][w] == "#" graph[h][w] [h] graph h w "#" right[h][w] = 0 right[h][w] [h] right h w 0 if w+1<W:
                    right[h][w] = right[h][w+1] + 1

     w+1<W w+1 w 1 W right[h][w] = right[h][w+1] + 1 right[h][w] [h] right h w right[h][w+1] + 1 right[h][w+1] [h] right h w+1 w 1 1 [1]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [1]*W [1] 1 W down = [[1]*W for _ in range(H)] down [[1]*W for _ in range(H)] for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

     h range(H) range H for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

     w range(W) range W if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

     graph[h][w] == "#" graph[h][w] [h] graph h w "#" down[h][w] = 0 down[h][w] [h] down h w 0 if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

     h-1>=0 h-1 h 1 0 down[h][w] = down[h-1][w] + 1 down[h][w] [h] down h w down[h-1][w] + 1 down[h-1][w] [h-1] down h-1 h 1 w 1 [1]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [1]*W [1] 1 W up = [[1]*W for _ in range(H)] up [[1]*W for _ in range(H)] for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

     h reversed(range(H)) reversed range(H) range H for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

     w range(W) range W if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

     graph[h][w] == "#" graph[h][w] [h] graph h w "#" up[h][w] = 0 up[h][w] [h] up h w 0 if h+1<H:
                    up[h][w] = up[h+1][w] + 1

     h+1<H h+1 h 1 H up[h][w] = up[h+1][w] + 1 up[h][w] [h] up h w up[h+1][w] + 1 up[h+1][w] [h+1] up h+1 h 1 w 1 ans = 0 ans 0 for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


     h range(H) range H for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


     w range(W) range W ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3) ans max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3) max ans up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3 up[h][w] + down[h][w] + left[h][w] + right[h][w] up[h][w] + down[h][w] + left[h][w] up[h][w] + down[h][w] up[h][w] [h] up h w down[h][w] [h] down h w left[h][w] [h] left h w right[h][w] [h] right h w 3 print(ans) print ans if __name__ == "__main__":
  main() __name__ == "__main__" __name__ "__main__" main() main def main():
    H,W = map(int,input().split())
    graph = [[""]*W for _ in range(H)]

    for h in range(H):
        graph[h] = list(input())

    left = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

    right = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

    down = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

    up = [[1]*W for _ in range(H)]
    for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


    print(ans)
    # print(up,"\n",down,"\n",left,"\n",right)
    # print(down) def main():
    H,W = map(int,input().split())
    graph = [[""]*W for _ in range(H)]

    for h in range(H):
        graph[h] = list(input())

    left = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

    right = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

    down = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

    up = [[1]*W for _ in range(H)]
    for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


    print(ans)
    # print(up,"\n",down,"\n",left,"\n",right)
    # print(down) main
import sys
sys.setrecursionlimit(10**9)

def main():
    H,W = map(int,input().split())
    graph = [[""]*W for _ in range(H)]

    for h in range(H):
        graph[h] = list(input())

    left = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                left[h][w] = 0
            else:
                if w-1 >= 0:
                    left[h][w] = left[h][w-1] + 1

    right = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in reversed(range(W)):
            if graph[h][w] == "#":
                right[h][w] = 0
            else:
                if w+1<W:
                    right[h][w] = right[h][w+1] + 1

    down = [[1]*W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if graph[h][w] == "#":
                down[h][w] = 0
            else:
                if h-1>=0:
                    down[h][w] = down[h-1][w] + 1

    up = [[1]*W for _ in range(H)]
    for h in reversed(range(H)):
        for w in range(W):
            if graph[h][w] == "#":
                up[h][w] = 0
            else:
                if h+1<H:
                    up[h][w] = up[h+1][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,up[h][w] + down[h][w] + left[h][w] + right[h][w] - 3)


    print(ans)
    # print(up,"\n",down,"\n",left,"\n",right)
    # print(down)

if __name__ == "__main__":
  main()
