def main():
    h, w = map(int, input().split())
    s = ["#" * (w + 2)]
    for _ in range(h):
        s.append("#" + input() + "#")
    s.append("#" * (w + 2))

    b = [[0] * (w + 2) for _ in range(h + 2)]
    for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

    u = [[0] * (w + 2) for _ in range(h + 2)]
    d = [[0] * (w + 2) for _ in range(h + 2)]
    l = [[0] * (w + 2) for _ in range(h + 2)]
    r = [[0] * (w + 2) for _ in range(h + 2)]

    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

    for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

    ans = 0
    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

    print(ans)


if __name__ == "__main__":
    main() def main():
    h, w = map(int, input().split())
    s = ["#" * (w + 2)]
    for _ in range(h):
        s.append("#" + input() + "#")
    s.append("#" * (w + 2))

    b = [[0] * (w + 2) for _ in range(h + 2)]
    for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

    u = [[0] * (w + 2) for _ in range(h + 2)]
    d = [[0] * (w + 2) for _ in range(h + 2)]
    l = [[0] * (w + 2) for _ in range(h + 2)]
    r = [[0] * (w + 2) for _ in range(h + 2)]

    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

    for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

    ans = 0
    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

    print(ans) main h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = ["#" * (w + 2)] s ["#" * (w + 2)] "#" * (w + 2) "#" w + 2 w 2 for _ in range(h):
        s.append("#" + input() + "#")
     _ range(h) range h s.append("#" + input() + "#") s.append s append "#" + input() + "#" "#" + input() "#" input() input "#" s.append("#" * (w + 2)) s.append s append "#" * (w + 2) "#" w + 2 w 2 [0] * (w + 2) for _ in range(h + 2) for _ in range(h + 2) _ range(h + 2) range h + 2 h 2 for _ in range(h + 2) [0] * (w + 2) [0] 0 w + 2 w 2 b = [[0] * (w + 2) for _ in range(h + 2)] b [[0] * (w + 2) for _ in range(h + 2)] for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

     hi range(h + 2) range h + 2 h 2 for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

     wi range(w + 2) range w + 2 w 2 if s[hi][wi] == ".":
                b[hi][wi] = 1

     s[hi][wi] == "." s[hi][wi] [hi] s hi wi "." b[hi][wi] = 1 b[hi][wi] [hi] b hi wi 1 [0] * (w + 2) for _ in range(h + 2) for _ in range(h + 2) _ range(h + 2) range h + 2 h 2 for _ in range(h + 2) [0] * (w + 2) [0] 0 w + 2 w 2 u = [[0] * (w + 2) for _ in range(h + 2)] u [[0] * (w + 2) for _ in range(h + 2)] [0] * (w + 2) for _ in range(h + 2) for _ in range(h + 2) _ range(h + 2) range h + 2 h 2 for _ in range(h + 2) [0] * (w + 2) [0] 0 w + 2 w 2 d = [[0] * (w + 2) for _ in range(h + 2)] d [[0] * (w + 2) for _ in range(h + 2)] [0] * (w + 2) for _ in range(h + 2) for _ in range(h + 2) _ range(h + 2) range h + 2 h 2 for _ in range(h + 2) [0] * (w + 2) [0] 0 w + 2 w 2 l = [[0] * (w + 2) for _ in range(h + 2)] l [[0] * (w + 2) for _ in range(h + 2)] [0] * (w + 2) for _ in range(h + 2) for _ in range(h + 2) _ range(h + 2) range h + 2 h 2 for _ in range(h + 2) [0] * (w + 2) [0] 0 w + 2 w 2 r = [[0] * (w + 2) for _ in range(h + 2)] r [[0] * (w + 2) for _ in range(h + 2)] for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

     hi range(1, h + 1) range 1 h + 1 h 1 for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

     wi range(1, w + 1) range 1 w + 1 w 1 if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

     b[hi][wi] [hi] b hi wi u[hi][wi] = u[hi-1][wi] + 1 u[hi][wi] [hi] u hi wi u[hi-1][wi] + 1 u[hi-1][wi] [hi-1] u hi-1 hi 1 wi 1 l[hi][wi] = l[hi][wi-1] + 1 l[hi][wi] [hi] l hi wi l[hi][wi-1] + 1 l[hi][wi-1] [hi] l hi wi-1 wi 1 1 for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

     hi range(h, 0, -1) range h 0 -1 for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

     wi range(w, 0, -1) range w 0 -1 if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

     b[hi][wi] [hi] b hi wi d[hi][wi] = d[hi+1][wi] + 1 d[hi][wi] [hi] d hi wi d[hi+1][wi] + 1 d[hi+1][wi] [hi+1] d hi+1 hi 1 wi 1 r[hi][wi] = r[hi][wi+1] + 1 r[hi][wi] [hi] r hi wi r[hi][wi+1] + 1 r[hi][wi+1] [hi] r hi wi+1 wi 1 1 ans = 0 ans 0 for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

     hi range(1, h + 1) range 1 h + 1 h 1 for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

     wi range(1, w + 1) range 1 w + 1 w 1 cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3 cnt u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3 u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] u[hi][wi] + d[hi][wi] + l[hi][wi] u[hi][wi] + d[hi][wi] u[hi][wi] [hi] u hi wi d[hi][wi] [hi] d hi wi l[hi][wi] [hi] l hi wi r[hi][wi] [hi] r hi wi 3 ans = max(ans, cnt) ans max(ans, cnt) max ans cnt print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    h, w = map(int, input().split())
    s = ["#" * (w + 2)]
    for _ in range(h):
        s.append("#" + input() + "#")
    s.append("#" * (w + 2))

    b = [[0] * (w + 2) for _ in range(h + 2)]
    for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

    u = [[0] * (w + 2) for _ in range(h + 2)]
    d = [[0] * (w + 2) for _ in range(h + 2)]
    l = [[0] * (w + 2) for _ in range(h + 2)]
    r = [[0] * (w + 2) for _ in range(h + 2)]

    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

    for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

    ans = 0
    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

    print(ans) def main():
    h, w = map(int, input().split())
    s = ["#" * (w + 2)]
    for _ in range(h):
        s.append("#" + input() + "#")
    s.append("#" * (w + 2))

    b = [[0] * (w + 2) for _ in range(h + 2)]
    for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

    u = [[0] * (w + 2) for _ in range(h + 2)]
    d = [[0] * (w + 2) for _ in range(h + 2)]
    l = [[0] * (w + 2) for _ in range(h + 2)]
    r = [[0] * (w + 2) for _ in range(h + 2)]

    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

    for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

    ans = 0
    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

    print(ans) main
def main():
    h, w = map(int, input().split())
    s = ["#" * (w + 2)]
    for _ in range(h):
        s.append("#" + input() + "#")
    s.append("#" * (w + 2))

    b = [[0] * (w + 2) for _ in range(h + 2)]
    for hi in range(h + 2):
        for wi in range(w + 2):
            if s[hi][wi] == ".":
                b[hi][wi] = 1

    u = [[0] * (w + 2) for _ in range(h + 2)]
    d = [[0] * (w + 2) for _ in range(h + 2)]
    l = [[0] * (w + 2) for _ in range(h + 2)]
    r = [[0] * (w + 2) for _ in range(h + 2)]

    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            if b[hi][wi]:
                u[hi][wi] = u[hi-1][wi] + 1
                l[hi][wi] = l[hi][wi-1] + 1

    for hi in range(h, 0, -1):
        for wi in range(w, 0, -1):
            if b[hi][wi]:
                d[hi][wi] = d[hi+1][wi] + 1
                r[hi][wi] = r[hi][wi+1] + 1

    ans = 0
    for hi in range(1, h + 1):
        for wi in range(1, w + 1):
            cnt = u[hi][wi] + d[hi][wi] + l[hi][wi] + r[hi][wi] - 3
            ans = max(ans, cnt)

    print(ans)


if __name__ == "__main__":
    main()
